There are a couple I can think of, both for the NES.
In Ninja Gaiden 3, the last level was full of enemies and each time you got hit, you'd lose 3 energy bars or fall into a pit. If you took too long, the timer would run out just before the last boss room. To add insult to injury, if you died at any point in the battle with the boss' 3 forms, you had to go back to the beginning of the substage. Worse, if it was your last life, you had to go back to the beginning of the level!
The other game many people have played. I'm sure you all know this scene well: