To expand on the reason I don't want to just play RAW and let the party get its just deserts: for dramatic reasons, I want to be in control of whether the characters have a chance to die.
- The DM always has this power.
- Roll your dice in secret. That way, your players don't know you are keeping them alive(ish).
- Don't have random encounters. Those tables are dangerous, imply a very dangerous world, exist solely to kill PCs, and I've seen more PCs die to random encounters than I have to all the BBEGs combined.
- Narrate any encounter where you don't want the PCs to die. "You find the room guarded by orcs. You slaughter them. We'll go around the table describing how." If there's no chance of death then it's a role-playing encounter that happens to be about combat, not a combat encounter. Treat it appropriately.
The hardest DMing lesson I ever learned was "the dice know when I should let a character die. Listen to the dice." In a two week period I fudged three character deaths, and all of them bit me in the butt, hard. Maybe your dice aren't as wise as mine, but my advice is to listen to them.
In that example, the group pursued two orcs into a room, the hallway became congested (paladin, fighter, and halfling ranger) and the rogue decided to go around to the back. This was about a 170-foot trip (down a conveyor belt, behind an orc sentry, and down a staircase).
Another example: One member of the party fighting a giant scorpion (can't remember if he was already grappled or not) and one of the other two goes around about 90-120 feet to come out in the other entrance of the room.
...
In any campaign I've run (or played in), the guy that ran off would have just "kited" one to three more encounters and all-but guaranteed either a) a TPK or b) him getting killed before he could rejoin the others.
It's one thing for a character to slink across the field and trigger the spiffy environment feature that wins the fight (or helps a lot). That's cool, cinematic, and fun. It's fun to be the distraction, it's fun to slink across, it's fun to position the foes, and it's fun to watch the environment do its thing.
It's a whole different shebang for a character to dive into a maze, hoping to come out in time and in location to be useful to the fight. That's one (or more) of: stupidity, cowardice, passive-aggressive PvP, total naivete, campaign sabotage, (bad) glory hogging.
A TPK is nature's way of telling you that your tactics need work.
I'm afraid you may just have to suck it up and follow The Auld Grump's advice.
Pain is the best teacher humans have, partly because everyone can learn from it. The pain of character death a) builds character (no pun intended) and b) makes you realize that you were doing something wrong. The trick to handling a TPK well is to be able to sit down with the players and after-action the fight to help them see what they could have done better and what mistakes they did make.
Good luck.