First of all, I have clearly stated HxD creates a backup. Your progress is completely fine.
Second, have you run your save through PKHeX? If you don't, of course it will end up corrupted.
Third, you don't even need to do this anymore. There is a button IN PKHeX that does that for you now.