They could implement places like the Hags lair where you cannot rest and block your path behind you so you can't just cheese it by running out.
This has been suggested and discussed in previous threads, including I'll bet the ones Melivy and I linked above. And it's of course something other games do.
But there are pros and cons. As I'm sure I've said before, I personally can see the rationale but it would annoy me in practice. I wouldn't normally try to rest in the Hag's Lair, for example, but if something went horribly wrong and I'd used up all my spells and short rests I think I'd be peeved if the game forced me to reload and start the whole area again. Even more so for somewhere like the shattered sanctum, where the idea would also make sense in principle.
I don't think there are any easy answers here, which is why there are all those threads talking about it

There's also a recent thread talking about cheesy mechanics you might want to check out (at your own risk!):
https://forums.larian.com/ubbthreads.php?ubb=showflat&Number=838995. I can't recall whether pickpocketing has yet been aired on that relatively new thread, though it's something that's cropped up in the past in other similar discussions.