There are a lot of seriously hurt, confused, uninformed, misinformed, damaged, hurting people out there who are so badly lost they are seriously constrained in what they can do.
Now, to be more clear, where they are constrained can be quite narrow and not broad. So, day in and day out, they can look fine. But for some real work in some well defined context, they can flop -- really be just unable to perform. Again, this can be tough to see without a lot of experience with them.
So, for firing, if you have a person who seems okay or even good in many ways but, still, somehow just can't do the job, with explanations, help, training, discussions, counseling, guidance, leadership, etc., then don't (A) be too surprised, (B) blame yourself or say that the fault is that of the organization, (C) conclude that you should try one more effort to fix the problem, (D) conclude that, of course, you should be able to fix the problem, etc.
Maybe reassign them to some work they can do, if can find that -- and sometimes it's possible.
Otherwise, just go ahead and conclude that they are unable to do the work, at least any of the work you have for them to do; don't be too surprised at this situation or conclusion; and let them go. Give them back to their families, the mental health community, the welfare system, or some such.
The big point is: Such broken people are surprisingly common.
For one level deeper, an explanation can be that their problems are not really cognitive or rational but emotional. And the main emotions can be fears, commonly from their being misinformed, uninformed, having had bad experiences, confused from what they have been through, etc.