I think the key is in not seeing "being wrong" as a "failure"
"I've failed" != "I'm a failure"
No one gets everything right all of the time. Accepting that and seeing hard problems as a challenge to overcome rather than a potential failure waiting to happen is, in my opinion, the way forward.
It's not so much that you see yourself as a failure, in my experience--it's more that, without frequent successes (however tiny) to push you forward, you run out of steam--that is, dopamine--and find it hard to want to try the next thing. It's the opposite of getting addicted to something: with no bells and dings and coins falling out, you become apathetic.
Try amphetamines to plow through the occasional grinding. A colleague of mine the other day (half?) joked that Sillion Valley runs on caffeine, amphetamines (Adderal, Ritalin, Vyvanse, etc) and cocaine. I think the same statement applies to Academia (at least the first two substances, not sure about the last one..).
"His colleague Alfréd Rényi said, "a mathematician is a machine for turning coffee into theorems", and Erdős drank copious quantities. (This quotation is often attributed incorrectly to Erdős himself. The German original, "Ein Mathematiker ist eine Maschine, die Kaffee in Sätze verwandelt"[11] of the sentence is a wordplay on the double meaning of "Satz": "theorem" or "residue of coffee", lost in the English translation)[12]
After 1971 he also took amphetamines, despite the concern of his friends, one of whom (Ron Graham) bet him $500 that he could not stop taking the drug for a month.[13] Erdős won the bet, but complained that during his abstinence mathematics had been set back by a month: "Before, when I looked at a piece of blank paper my mind was filled with ideas. Now all I see is a blank piece of paper." After he won the bet, he promptly resumed his amphetamine use."
As they say in The Men Who Stare at Goats, "Amphetamines- Not to be abused, but very fucking handy."
EDIT / Disclaimer: If you (the reader) decide to try this, do your own, thorough research. It IS risky and it can end very badly for some people. You've been warned.
Focus XT has been nice for me (like a steady pot of coffee (which is inefficient with tolerance building) at a steady rate without any jittery crashes.
Dgrove, quick heads up: you're hellbanned, and most people can't see your posts. Your recent comments have been positive, so I'm letting you know. Try e-mailing PG about it.
"I've failed" != "I'm a failure"
No one gets everything right all of the time. Accepting that and seeing hard problems as a challenge to overcome rather than a potential failure waiting to happen is, in my opinion, the way forward.