With HOME 2.0, they made an internal data structure in their servers that can hold separate partitions for a Pokemon.
If I’m not mistaken, the partitions are for: LGPE, SWSH (default Gen 8), BDSP, and PLA.
Typically, if you transfer a mon between games via HOME, any exclusive data (moves, balls) will get written to their respective partitions, and gets left out from the other partition. And it remains associated to the Pokémon via HOME tracker.
For example, a Pokémon with Gigantamax would have the data for it in the SWSH partition, but left out from the rest. When you withdraw such a Pokémon in PLA, that byte won’t be there in the pa9, but would be given back to your Pokémon when withdrawn back in SWSH.
The reverse is true for Alphas from PLA -> SWSH, as well as any unique PLA balls. They are temporarily Poke Ball and non-alpha in SWSH, but shows back up with sent to PLA.
So basically, if they don’t have a valid HOME tracker with sent in from the correct game, they may become illegal when transferred to a different game via HOME. (Kinda why I did my HOME compatible living dex)
by extension, the proper ball and first met location is tied and tracked by HOME tracker. You probably changed something that resulted in HOME not being able to recognise it.