A few RPG traps I can think of:
In Dragon Quest 2, there is one enemy, encountered near the end of the game, that can cast a spell called Sacrifice (in classic translations) when it gets low on HP. When that spell is cast, it kills your entire party; there's no way to survive this, (though this enemy is fortunately not immone to StopSpell), so it's an automatic game over. To make matters worse, there's a miniboss in the final dungeon that is a palette swap of this enemy, is immune (or nearly immune) to StopSpell, can cast Sacrifice, and that you *have* to fight to beat the game.
In Final Fantasy 5, in the final area of the game, there is a chest in a somewhat prominent place. You open the chest, and out pops Shinryu, who then proceeds to wipe the party with a tidal wave doing ~7000 damage to your party (who typically has 2000-3000 HP at this point). This battle can be won, but it's one of the game's superbosses, and as such you are not going to have a chance unless you're prepared. (You can run from this battle, but Shinryu is likely faster than you, so you will likely be hit.)
Also, in some Final Fantasy games (4 being the first one where you start to see this), there are enemies that are scripted to counter certain types of attacks rather harshly. For instance, Behemoths are known to counter spells with attacks like Maelstorm and Meteor.
Speaking of Final Fantasy, Final Fantasy 2 has trap rooms. You enter the room, there's nothing in there, and when you try to leave, you are almost guaranteed to get into an encounter. It's not a harsh punishment, but it's annoying and punishes exploration (though it might not be such a bad idea if you want to deliberately get into encounters so you can boost your stats and skills, of course).
In Guadia Quest Saga (subgame of the Japanese DS game Game Center CX 2), there are two enemy types that always appear together. If you kill one of them, the other one uses an extremely nasty explosion that does tons of damage to your party (and dies in the process). Not as deadly as DQ2's Sacrifice, but still nasty (although you can use the defend command if you know about this).