Also, disasters like droughts, volcanoes, or even civilian uprisings can generate widespread blowback and unintended consequences, to wit: the Arab Spring & al.
And a government finding itself in imminent peril might well resort to a nuclear option.
Yes, plenty a SF author has imagined various ways to end the human race as we know it, often with the unexpected consequences route. I rather like one from Joe Haldeman, in
The Forever War, where instead of being ended, exactly, the human population is changed again and again, to being no long much at all like it had been, so kinda replaced. It reminds of one novel or was it a story (or stories?) I'd read (so many!), where something like cultural evolution happened to where that people were just kinda
"meh" about reproducing, and faded out, caught up in other pursuits.