One-Way Entrance

"And consider this dismaying observation: this chamber has no windows, and no doors. Which offers you this chilling challenge: to find a way out"

- Haunted Mansion ride

If the protagonists go into a haunted building, you there is a non zero chance while your back is turned the walls and doors will turn into hole-less walls, leaving the unfortunate protagonists trapped inside. A less supernatural variant is for the doors to slam shut behind them and refuse to open.

See also: Locked in a Room and It Was Here, I Swear

Amusement Park Rides

 * This is part of the story of The Haunted Mansion Disney ride.

Video Games

 * The Evil Within 2

Western Animation

 * Samurai Jack and the Haunted House.

Tabletop Games

 * Considering you can't just leave through the front door of Betrayal at House on the Hill, and the genre, this trope is in play.