I almost never get mega events for some reason. I haven't had mega spies pop up in the past year of playing the game - they used to happen fairly frequently, now I just don't see them.
But for the most part they are the same as normal spies - when the planet flips, the new owner is stuck with them unless they were his to begin with. It's only when the improvement is destroyed that this issue pops up, and I haven't yet seen that with mega spies. Hell, I've only seen it with regular spies once. Given the lack of people popping in and saying "yeah, that happened to me too" I'm guessing the vast majority of players will never see this unless they specifically try for it.