Grey goo, and/or overuse of energy.
Mind that even if we find completely "clean" ways of satisfying our energy "needs", that's no guarantee we'll be safe from the abuse of it. If we capture a large part of the energy that comes to earth, and harness it, rather than letting it escape into space? Heat. Lots of heat. Who says necessarily that all global warming comes from CO2? What if it's increased heat production?
Warming our homes in winter dumps lots of heat into the atmosphere that wouldn't otherwise have been there. Air conditioners are even WORSE. Our very population is generating a great deal of thermal energy. As does burning of fossil fuel - either in cars, or electricity generating stations, or for industry etc.
If we make a cold fusion reactor, well... that could very well be game over unless we're very careful. A good number of those would be like hundreds of contained nuclear blasts every day. Or having an extra miniature star come into close orbit. The energy released by all that matter manipulation has to go somewhere. Into the environment. Where some will be radiated, but a lot will be trapped, because it's not as if we NEVER had ANY kind of greenhouse effect before the industrial revolution (we've merely "improved" it is all). Hot hot hot!
Now where does the grey goo come into this you ask... how many of you have read the trashy but otherwise awesome-gorgeous Adam Warren penned Dirty Pair story "Sim Hell"? For those who haven't, SPOILERTOWN AWAITS.
The pair's archnemesis has inoculated himself with protective nanomachines to keep him in good health and rapidly repair any bodily injury. The problem is, those machines still require energy, and as they do a lot of work in a very small space, they generate it at a rate massively disproportionate to their size. Much like a larger machine, external machine doing the same job, but in seconds rather than hours... taking the fuel they need from his blood (glucose) or surrounding tissues, and dumping the wastes and heat back into the medium in which they're suspended, ie his blood, tissue fluid and tissues.
The area in question gets painfully hot. But it's considered well worth it to recover from, say, a potentially fatal ruptured artery before even a significant amount of blood can be lost.
The way to defeat him? Beat the everloving crap out of him until you are yourself totally exhausted... varying your attacks as much as possible to hurt him all over, and making them lifethreatening where you can. Bingo, one murderous, perverted perp, cooked from the inside by his own protective systems.
Nanobots that do anything of note will make a lot of heat unless they work slowly and in isolation. In a grey goo situation this isn't the case. They're operating full pelt to transform everything around into copies of themselves. It will get hot, fast. The question is whether they can keep operating in temperatures high enough to kill all terrestrial life, or whether they'd denature/seize/etc and become self-rate-limiting.
There's also that whole "turning the entire earth into copies of themselves" thing too. Troublesome. But not an actual species threat if we've managed to make offworld colonies by then. (Another thing Warren actually covered in the same story... as earth has actually suffered a "nanoclysm"... but we've expanded beyond the solar system by that point, so it's more just dreadfully sad/horrifying than a "we're ALL gonna die!" scenario)