that is weird.
If it is accurately named main, and only main (no extensions), correct sized, in the correct folder, it shouldn't cause corruption.
People have posted something like this before, and I don't think it gets resolved, simply because it shouldn't happen like that.
Here's one more thing I'll like to ask you.
Try opening Citra with the modified save, make sure PKHeX is closed.
When you get the error message, close Citra (don't delete and don't save).
Then drag that save into PKHeX. Does PKHeX read the save?