In the episode Ship in a Bottle, Professor James Moriarty wishes to leave the holodeck. The whole episode is centered around his complicated gambit to do just that, by giving the illusion to Picard that he already has. But in the beginning of the episode, they urgently implore him not to walk out of the holodeck.
Later in the episode, Barclay, Geordi, Data, and Picard brainstorm ways to transport Moriarty's love Regina out of the holodeck, but they are very cautious about it and don't want to try anything on her until they've thoroughly tested it on other objects, presumably because of the risk that she too could "cease to exist."
But why? Why wouldn't there be multitudinous backups of James and Regina in holodeck memory? Just as "ending a program" saves the program to memory, why wouldn't a holodeck character walking out of the holodeck cause him to "disappear" while still "existing" in memory?
This is a different (though related) question from Why can some holodeck matter leave the holodeck, while other holodeck matter (notably people) cannot? Reading both questions (and their respective answers) in full makes this quite clear. My question is, "Why wouldn't Moriarty's program continue to be saved in memory if he tried leaving the holodeck?" Though the other question uses Moriarty as an example, it can be generalized as, "Why can't holographic people leave the holodeck when some objects created in it can leave?" Both questions are about the mechanics of the holodeck, both are about what happens when certain holodeck objects try to leave, but they are ultimately about different things and have different answers as a result.