My department had our recruitment weekend a couple of months ago, where admitted students to the PhD program could visit labs, interview with faculty, chat with current graduate students, and generally get a feel for the campus and the city. One prospective student asked several of us to list our best, worst, and most surprising moments of graduate school. I was interested to find that all of us had basically the same answer for worst moment: the project that went wrong.
My story fit the theme. I worked on an experiment for the better part of a year that ultimately didn't work. Couldn't work actually. I eventually was able to prove that the approach would never work.
This seriously threw me for a loop. I had a really hard time recovering and moving on to the next project. Maybe that seems silly to you, but almost all of my colleagues had a similar story. We can all speak about the project that simply failed.
Students in a PhD program typically excelled in both high school and college coursework. But a PhD is something completely different. You are doing original research. There are no longer answers in the back of the book. Your advisor can't tell you what's going to happen. Nor can other experts.
You just have to try it, and sometimes, you're going to be wrong.
It's in many ways the hardest thing to learn as a PhD student, but I think it's also one of the most important. It seems that Silicon Valley feels the same way, to the point that there even exists a conference specifically on failed ventures.
Ultimately, there's not much reward without risk. Sometimes, that means you fail. But sometimes, it works as well or even better than you predicted.
And that is the best part of a PhD.