When I was a graduate student in a highly competitive engineering program, I did not pass the written candidacy exams. I had spent three years taking courses in preparation for the exams. The exams were only offered once per year, so for the next several months I wallowed around trying to decide whether to dedicate myself to studying for the next year or change fields. I tried courses in other fields and eventually got a part-time job in natural resource management which led to an advanced degree. The experience left me completely demotivated to learn engineering, something I had loved since a child.
I am not sure what could have been done to prevent or correct this. I know these systems are in place to allow the best candidates to float to the top, but there must be many individuals who have been turned away from their passions who could have been given mentoring to prepare for candidacy exams or counseled into related career paths after unsuccessful exams.