Forum Discussion
This is not a bug. It's happening because the game removes ghosts from the game and is called culling. Once a ghost is removed, it deletes the Sim entirely as if they never existed. Gen 3 is around the time when this happens a lot and become noticeable, it includes Sims that are in your family. You can prevent the culling of specific ghosts by strengthening the Sim's connection to the world at their grave or urn. If you don't have their grave and don't use mods to make them a new one and summon them to it, then they will be lost forever. Once the Sim disappears, the connection to the family tree is lost as well, because that relationship no longer exists.
Culling is important to the health of the game because the more Sims and ghosts that exists, the more memory is needed for the game to run and it increases lag and other problems. However, it is unfortunate that the family tree is incapable of archiving Sims and relationships and they just permanently erase. It was my hope they were going to fix this with Growing Together but they did not.
The game will also cull non-ghosts from time to time but it's mostly ghosts.
This is indeed a bug, because there was a patch note claiming this was fixed a few years ago.