I won't change a die roll, but if the players engineer a TPK sometimes I don't tell them. This is the source of the idea SES-001 The One with the Killer Hook, a post I made in 2020.
The party was in a small town, in the shadow of a large castle. The castle fell into enemy hands and the party took it upon themselves to recon the castle for the King's Army. However, instead of communicating with the Good King's siege force, they began hit-and-run raids in and around the castle. They had a secret way into the castle and used it to incredible effect. They managed to take out the water supply, start fires, steal the royal seals from enemy hands, and even take a very powerful artifact before they goofed.
The goof was one of their own making. The artifact was a ring of wishes that they hung onto "in case something bad happened", like a death. The second bit was taking out the water sources and setting fires. The castle was on the verge of surrender due to the water issue when the characters went after the last well. They got cornered by a pair of magic users and when the first fireball went off, they jumped into the well.
The empty well...
This should have been a horrifying TPK, but I decided not to tell the party. The next session, they escaped the well and went on to be a very effective team, reaching 6th level before they finally had "something bad happen".
They used the ring to wish a dead character back to life. Except, they were already all dead.
They found themselves back in the well and later replaying the events of their first couple of sessions. It seemed poetic. And fun.
Over the next couple of sessions, I used my notes from the campaign to create a montage of the party's greatest hits. We spent whole evenings throwing dice, reliving the events that led the party to such highs.
It was a fun ride.