There are situations where characters can accidently be deleted if you switch during an inapropriate time, EG, if you use /editor to enter editor mode, your character is "Removed" from the game field, and restored upon typing /editor again, placed in your new location. If you switch characters while in this mode, the hidden character is deleted when you switch, because it exits editor mode.
I have put in a safeguard against this, where it will check if you're in editor mode, and then try to leave it before switching characters, but if other mods do similar trickery, my mod can't really detect if they've done something, and simply switch character. Normally whenever you have a character in a vehicle and try to switch, the game engine will cause the passenger character to be kicked out of the vehicle. Again, if Space Exploration does some sort of trickery to accomplish what it is trying to do, my mod might not be able to detect that, and breaks the state. You'd need to trigger space exploration's "Give me my character back" logic to restore it, which you probably can't do anymore, because you're not in the state that mod put you in.
As for the naming... the way my mod stores names is to by the entity's "unit number", all objects in the game world are entities, biters, buildings, characters, vehicles, and items on the floor. Every unit number is unique, and if you delete it and recreate it (which something like space exploration might be doing) then the recreated entity would have a new unit number, and therefore the name wouldn't be associated with that character anymore.
There's only 2 ways to keep track of an entity. Store a link to it (a referenced object), or store a unique piece of information about that entity. Since you may own multiple entities of the same prototype, the only unique information about the entity is it's unit number. (also, you can't reference a table using an object), and can't really store "non-relevant" information on an object itself, therefore the method I used was the only real viable option.
Verify for me, when my mod doesn't restore the name of a character, have any functions been performed on the character such as, it being removed from view (Outside of getting into a car, tank, train or spidertron) or changed in some way (EG, Minime mod deletes the character entity and recreates it with a new prototype which has graphics reduced in size)