Samsung devices are notoriously picky about cables. Ensure you are using an OEM high-quality data cable.
When you download Samsung firmware, you often get two CSC files. Keeps your data but does not change partitions. CSC: Wipes your data and re-partitions the phone. repartition operation failed odin
Use a USB 2.0 port if possible. USB 3.0 ports are known to cause communication "hiccups" with Odin. Samsung devices are notoriously picky about cables
In Odin, go to the Pit tab (next to Options). A warning will pop up; click OK. Load your extracted .pit file here. Keeps your data but does not change partitions
If your "OEM Unlock" or "FRP Lock" is enabled, the device will reject any attempts to re-partition the storage. Phase 1: The Quick Fixes (Try These First)
Fixing the "Repartition Operation Failed" Error in Odin: A Complete Guide