Miserably means in a very unhappy way, or utterly and completely. Sat there miserably, failed miserably, miserably cold.
The second sense is the commoner and has nothing to do with unhappiness: failed miserably means failed completely. It goes with fail above all, which is why the phrase sounds fixed. Miserably cold means unpleasantly rather than sadly.
1adverbmiserablyIn a very unhappy way, or utterly and completely.
“The children sat miserably in the car as the rain poured down on their beach holiday.”
miserably is a manner.
Miserable plus -ly, from Latin miserabilis, pitiable, from miser, wretched.
Middle English
myserablie
English, today
miserably
From Middle English myserablie; equivalent to miserable + -ly.
Etymology from Wiktionary, CC BY-SA