As far as I can tell, the problem arises from the way bases get saved on the server. Your own base is saved locally, on your computer. So you can always see it.
Other players, however, do not have access to your computer. They can only see the copy of your base that gets uploaded to the server.
However, the server will only accept one active base per system. If there is already an active base in a system, and another player builds one, then the original player’s data will be overwritten by the new one.
The original player may not be aware of this. They can still see the local copy of their base. But visitors to the system will now only see the version on the server, which is the new player’s base. The original one will have disappeared.
If the second player, whilst still in the same game, builds a new base in a different system, then their presence in the first player’s system will be removed from the server. However, this will not re-establish the first player’s base. For that to happen, it seems to be necessary for the first player to turn off base sharing, make some changes to their base, then turn base sharing back on again. This seems to force the server to upload and refresh the original base owner’s data once more.
Unfortunately, the process doesn’t always work. The server can become confused, and continue to try loading data from both bases. If this happens, the system may become permanently unstable, prone to crashes, data errors, and generally unusable.
If you find that you have built a base in someone else’s system, my advice is to move out as quickly as possible, and build another base in a different, unoccupied system. It is essential that you build another base, however crude and temporary, because it is only when you do this that your data from the previous base gets erased from the server. It doesn’t always work, but it’s the only cure I’m aware of.