Unfortunately not all SD cards, even if advertised as the same capacity, are exactly the same size. If your replacement card is just 1 byte smaller your dd clone won’t restore - the “free” space has to fit into the target card as well.
Long story short - most popular methods of cloning microSD cards for the Pi only ensure the ability to restore to a larger SD card, not necessarily one of the same advertized size.
For sure there are workarounds, but it’s not as straightforward as you might assume. Personally I’m much more a fan of other tools such as rsync or version control etc for cloning data to and from Pi projects.
The better answer is just to USB boot the Pi anyway - they’ve supported this for a while now, no card corruption issues to mitigate.