were the bad eggs there before the corruption?
maybe your save corrupted starting from a certain point (which visually would be starting from where you shown, box 25-26 ish), and messed up everything behind it.
If you refer back to the image I shown earlier, the last 2 blocks in the save is BOX and JPEG, so maybe that's what happened.
Well, you could just clear the boxes with PKHeX.
In any case, just glad it all worked out :3
And in the future, always keep periodic save backups. If your cart is dying, it would be good to keep backups before it RIPs.