This is the sort of thing that sounds very bleak to people who imagine being judged the same way, possibly unfairly. And it's even more painful because someone on the cusp may not be sure themselves that they can or can't function.
However, it can be empowering, in that someone recovering from health issues can realize that technical chops are almost entirely irrelevant; the task is just to convince the interviewer that they can and want to come to work every day and grind it out, and if a person truly knows their own ability to do so, it is possible to convince other people.
Unfortunately it's terrifying to hear that success depends on belief, because bootstrapping yourself from not being employable seems like a contradiction in terms. It can make people very bitter when they believe their only chance of survival is to behave in a way they don't feel.
This means being able to make it through a job interview without having a temper tantrum.
I can tell you that these were very obvious "no" situations.
In one case, the candidate was incompetent and only made it to on-site because of a horrible HR snafu. The resume shouldn't have made it past screening.
In another case, the candidate nearly started an argument with me over what was essentially a game of "let's pretend" so I could ask some very mundane SQL questions.
Both of these candidates were extremely slovenly in their appearance.
> I suspect that your mental health cop out is nothing but a rationalization for your unfounded biases.
I think you also need to inspect your biases. Both of these candidates were fundamentally unfit for office work; not cases of someone failing an interview because they didn't write fizzbuzz exactly the way I would.