Total catastrophic failure, or should a GM ever allow re-rolls and do-overs?

It’s a critical moment in the game at the end of a marathon session, everyone is on the edge of their seats, and the player rolls… a 1. Evil bad guy wins, party dies, game over. As a GM, what should you do? Probably don’t structure your game to hinge on the result of a single roll, right? Well what if it was an improbable-but-possible series of bad rolls?

Should you ever let people re-roll after failing? I’m thinking no, otherwise everybody will want to re-roll after every bad outcome.

What about letting the party start over from when they first entered the room? Just for the sake of convenience and without any sort of time reversal game mechanic.