The sendpkm you referred to is just another fakegts, like ir-gts-bw and the like.
PKHeX is a save editor; you can also get pkm files from other tools like PokeGen and PikaEdit; hence why your topic was moved out of the PKHeX forum.
Try to use a fakegts like shiny2.5: https://github.com/Gannio/Shiny2-and-a-Half
You host it yourself within your own network.
Injecting PKM data via GTS does not do anything besides inject PKM data. It will not change your save file to facilitate in-game events.
You're better off just hacking your console and editing your save file directly.
Gen8+ save files are encrypted and hashed; by mutating part of the save data haphazardly, you've invalidated the signature that authenticates it as valid. Hence why the program does not load it.
If there isn't a block listed for ogerpon, then it isn't known how to respawn it. Usually your best options are to restore a backup save before the event, or if you're only after the resulting Ogerpon, just use the encounter database to create one.
Restore a backup of your unedited save file.
ROM hacks that change how the save file structure is saved will not usually accept save files that are modified by unmodified-game save editors.
If you did not use a save editor, then try using one to see if it is recognized
Use the emulator menus to import your editor files; same as you did after you dumped your save file/ROM from your cartridge to resume playing on emulator.
Use the command builder drop-down to assemble your filters in addition to commands. You can filter only files from one context (e.g. PK9 is Gen9) or based on Version ID (run once for SL and again for VL).
You're more than capable of doing a tradeback with someone else and observing which fields of the Pokémon's data changed. I'm not going to spoonfeed you the exact steps on what to change because it's already quite evident from this thread (that you necro'd) what you would need to change.
Read the messages in this thread, and rub your brain cells together instead of wanting someone to move your hand for you.
Was able to get it to load after rearranging some data in the file and trimming junk written at the end of the file.
Inventory, Fashion, and LiveMatchData might have issues, but you can probably work around that.
main
Use the encounter database to generate a Gastly.
Level it up to the level it would evolve into Haunter at least.
Set all the required fields as mentioned above to indicate that it was traded, so that it can be a Gengar that evolved via trade.