I have to say also that this type of crisis is not surprising (unfortunately) for math, or similar highly theoretical, loner fields. I can guess that the student asking the question is not being very open with his/her advisor, has worked and struggled for long hours alone, thinking they have to solve it on their own, and is not super communicative and checking in about important aspects of the thesis. Because he/she thinks it has to be a surprise "breakthrough" result -- a heavy obligation of the field's expectations.
No responsible advisor would let the work get to such a state, so late in the game. Major fault of the advisor too, here.