You acknowledge the difficulty he is facing. Don't dismiss his worries.
He wants you to know, if he didn't get it right, it's not because he didn't try hard enough, it's because it's harder than YOU think it is.
Praise his effort. If he didn't get it 100%, still praise his effort.
Remind him to focus on the problem itself. Whether he gets it right is not an indication of his worth in YOUR eyes.
He is now becoming more self-aware. But his sense of the "self" is small relative to the problem he is facing. He feels inadequate. By confining his thoughts to a limited pattern (牛角尖), he attempts (unconsciously) to reduce the problem down to his size.
Or, he is merely managing your expectations (Mom, don't you see I am trying hard?)