My best character yet. Bronan II was on the third floor of the Sokoban puzzle, more than halfway through solving it. He had slain cockatrices and golems and barrow wights, even some winter wolf cubs and a gelatinous cube. He carried Cleaver, a gift from his god. Things were looking...well, not up exactly, but far from dire.
Alas, Bronan II forgot one very very basic tenant of dungeoneering: always remember to stay well-fed. While pushing boulders around, he fainted from sheer hunger. A swarm of bats, normally easy meat for the mighty warrior, sensed weakness and swooped in. They bit the barbarian again and again, and when Bronan II finally regained consciousness he was on death's door.
Bronan II was in a jam, alright. He had some magic wands, though nothing that would save him. He had numerous potions and scrolls, but they were all unidentified. Using the correct one could save his life; using the wrong one meant certain death. The barbarian decided that the best course of action would be to write the sacred word Elbereth on the floor, hopefully scaring the evil beasts away long enough for him to regain some measure of strength and mitigate some of the risks of blind potion tasting or scroll-reading. In fact, he wrote Elbereth twice.
Perhaps his handwriting, never the best, was just too poor to be effective. The unfazed bats dived in and tore open Bronan II's neck, and he died with his quest unfulfilled.
NetHack. The worst thing: not only did I indeed have a healing potion, but I had somehow scored a freaking blessed scroll of genocide in my early explorations. I could have wiped all bats from the face of the universe in order to save Bronan! Alas, YASD.