There's a germ of truth in all stereotypes. But the germ of truth here isn't that the English are miserable, but rather that the English are particularly good at enjoying things going wrong, including the grumbling - it quite cheers them up.
The underlying assumption is that, if things are bad, they could well get better; if they are good they are bound to get worse. So bad times are the times you can relax and look forward hopefully. Historically that is symbolised by Dunkirk and the Blitz.
"We'll meet again -
Don't know where, don't know when -
But I know we'll meet again some sunny day.
Keep smiling through, just like you always do
'Til the blue skies chase those dark clouds far away."