I've done this before with vampire sims. I built a whole dungeon- except I just lock the cell doors, not delete them, for aesthetic. Why don't you do that too??
The only time they disappeared was when I left the lot...
Sooo Maybe try it with just locking the doors (add them to group --> "walk here with group" into the cell ---> lock door to allow only you --> disband group)
Because *maybe* the game will recognize that they are purposely locked in instead of just trapped as a possible result of a glitch/stuck, forcing the game to correct it.
Just a thought, though. Not sure if the scripting is that smart.