Quite a few years ago, when running a Forgotten Realms campaign, while the PCs were trapped, unbeknownst to them, in a demiplane at the end of a lengthy subterranean adventure, I introduced a cave filled with statues on plinths.with plaques, each bearing writing - some familiar, some completely alien to anything they had seen. Each statue seemed to depict a warrior of some sort in an action pose.
This room, in keeping with the whole basis of the Forgotten Realms, was a room full of portals. In order to activate any individual portal, a person need only to read the name inscribed on the plaque aloud and reasonably well. At this, all characters in the room would be transported to a location fitting the statue subject's locale, with said subject present and battle ready. Initiative was immediately rolled.
The trick to this was, if any of these people were defeated in battle (Often single combat with the person who spoke the name), then the PCs would be transported back to the statue room, but that locale - without the mandatory fight - would be open from then on, by simply standing in front of the statue and speaking the name again. If a PC failed to defeat the subject, then that area was locked for a year and a day more.
One of the statues, of course, led back to Faerûn, the rest led to different campaign settings, and one, featuring the name "Wm. H. Bonney" on the plaque, led to an alternate Earth that the PC would have to face Billy the Kid for entrance. Though this statue's subject was tested, that plane remained locked. When it seemed as if the group were destined for entrapment in the Demiplane of Dread (the Ravenloft campaign setting), because the subject featured was a former inhabitant of the Realms, a Knowledge (History) check revealed he had been missing for decades, and the PCs chose the wrong plane in the end (surprisingly, my homebrew of Khardtha - keeping in mind I told them nothing about where they actually led), they eventually were able to go home.
I understand that while this wasn't truly a trap OR puzzle, it had features of both and could have been very detrimental to the party, as they could have been trapped in certain locales or locked themselves out of all the portals with a string of losses, which would have been worse, since they were the only way out of the demiplane they had found themselves in.