The trap we are talking about can be rather deadly so use at your own risk.
It might not be a big surprise that one of my favorite traps comes out of my favorite Dungeons and Dragons adventure The hidden shrine of Tamoachan.
The will-o’wisp sandbox: In this trap you see a light flickering around the corner, once you come closer the light moves away always staying just out of sight and behind the next corner.
If the party follows it long enough suddenly they step on a pressure plate, in front of them and behind them a stone wall falls down. They hear a grinding sound coming from above them. Roll for initiative.
Lifting the walls self should be a though challenge. A DC of 20-25 depending on the level. After 3 rounds sand starts to poor into the room. Making the terrein difficult to move in. After a few rounds strength checks are needed to move in the room.
To make matters worse after 1 round the light that the party was following. A will-o’wisp moves back in the room and starts to attack to party. Preferably the ones doing the lifting.
The longer they take to find a solution the more dire their situation becomes. The best solution is probably lifting the gate or teleportation. Let the players be creative but it should be a tense and dangerous situation.
I find this trap very thrilling, but it can be deadly make sure you now what to do when the players die in here. Roll now characters, get dig up a few hundred years later, that kind of things.