In my case, I got to advanced math my junior year of high school, got my first B+ on my report card EVER, and considered suicide. (And I am not otherwise a depressed, suicidal person.)
I am convinced that learning to fail, and to recover from it, and even to become better because of it, is one of the most important lessons we can teach our children. First of all, no great discoveries are made without lots and lots of failures. If our kids are ever to do the great things they are all capable of it will only be because they manage to respond to these failures creatively and with enthusiasm. But even more importantly, no life is lived without failures. The person who can't confront them, and even relish them, becomes very brittle indeed.
My story is like Kriston's but even more absurd. I wasn't confronted with my suicidal moment until I was already in my second or third year of graduate school (my undergraduate and graduate work was compressed, so it's hard to know how to count it). My failure to achieve an absurdly prestigious scholarship nearly drove me over the edge. It was a completely ridiculous reaction, and it would have been funny if it wasn't so serious. It took me the rest of my years in graduate school to learn to deal with it. I'm absolutely convinced, though, that whatever success I've had since then is due in much smaller proportion to my intelligence than to my ability to persevere in the face of failures, and the related ability to take risks that I otherwise wouldn't have imagined.
I don't know how, exactly, we teach this kind of lesson to our kids. But I'm convinced that it's one of the most important things they can learn.