If you are flashing the exact same firmware version or an update (not a downgrade or region change), you should not be repartitioning at all.
Odins versions 3.12 and above sometimes enable Re-Partition by mistake if they detect a PIT file.
Solution: repartition operation failed odin
If the firmware was correct for your phone, this solves the problem 50% of the time. If you are flashing the exact same firmware
Believe it or not, a simple CRC error during the PIT transmission can cause the phone to reject the repartition command. This is the easiest fix to attempt first. Odins versions 3