PKHex to receive mystery gifts?

Okay- so I downloaded PKHex to get myself a Keldeo and some other mons in Pokemon X, right. I didn’t mess with any settings, just imported all the keldeos that the “Mystery Box Database” has found and now my save is corrupted, thankfully I made a backup but how do I use PKHex properly then?

And since we’re on the topic, can I also edit my Scarlet save and get myself some gift mons?

Edit: I’m playing X on Citra, and Scarlet on Yuzu