In an episode of Friends, Chandler is in an ATM vestibule when a power blackout happens. The door to the vestibule automatically locks and he (and a supermodel) are trapped inside until the power comes on. Is this legal? There is this related question:
Can I legally trap someone on my property that has committed a crime?
But no one has answered it. It seems like banks are allowed to detain you even though you've done nothing wrong. It's easy to think of scenarios that would make this worse. Instead of a supermodel for company, instead you have a full bladder. Or you popped out for a second to get cash and now your kids are home alone for hours.
I recently read a similar (real) story about a guy in the UK getting trapped. So either a US or a UK answer would be of most interest to me.