So since clarification is required, let me clarify some points. As explained in the comments, the question is specifically about a person who is psychologically fragile:
“she already consults psychologists for several years”
“Being depressive, she also takes a lot of things personally”
“During the meetings, she practically doesn't participate, and also takes everything personally.”
“she barely speaks to her coworkers or her manager”
etc.
So no, this is not just “an assumption of psychological fragility”. There are further elements which show that this person is fragile, but I'm not happy discussing them openly, and the elements which are already in the question are largely enough.
The fact that she is a woman and has a disability is just a piece of context. Without this piece of context, the obvious answer would be to fire the person; it was obviously necessary to explain why the person cannot be fired (that is because of a lawsuit in the past and because of the disability of the person). While this information is important, it remains just a contextual info, and nothing more. By putting it into the title, you indeed denatured the question.
As stated by Hugo Rocha:
The sex is irrelevant. The disability is irrelevant. She should be treated as any developer with poor performance results. If I was in your place, I would not even state the sex of the developer in the question.
Actually, she could be a he and a brother of the investor, making him a person nobody can fire. This wouldn't affect the question, nor the answers.
On the other hand, remove the “psychologically fragile” element, and the question changes radically and the answers become mostly invalid.
About job qualifications
it seems to be a question about an employee with legally special status (disabled, woman) who doesn't have the job qualifications. The question proceeds with several more paragraphs explaining specifically what skills are lacking.
No, not really. The question is about an employee who has job qualifications (otherwise, she wouldn't be hired in the first place), but is currently unable to use her skills to their full extent. The difference is crucial. It's like asking what to do with a coder who don't know how to program versus what to do with a skillful developer who, because of some temporary problems, is unable to work as one would expect.
I've seen her resume. She was perfectly able to perform her job five years ago. It's just that personal reasons put her in a position where she has difficulties she hadn't five years ago.
Should the question be edited?
I've received four great answers which are very helpful. Those four people understood the problem, and answered the question itself, not the denatured "What to do with a disabled employee"-style question.
On the other hand, there are at least four other persons who did not understand the question, proving that it is not perfectly clear. This is annoying.
Some found it too long. I don't see how can I shorten the question without loss of useful illustrations.
But more importantly, I don't see the reason to waste my time for that: if those persons don't want to read something because of the length, they can skip the question and read other, shorter ones.
Some misunderstood it. This is a more important concern, because it means that the question may attract wrong answers (given that the question is protected, which reduces such risk).
Maybe my bad English is the reason. Maybe it's the way I formulated the question. After thinking a bit about it, here's an edit I can suggest. What do you think about it? Any suggestions?
The modified paragraphs are in italic. I also replaced "she" by "he".
Suggested edit
How to prevent a psychologically fragile person from harming a team?
I'm currently advising a team of six developers working in a company which relies on this team to handle all in-house projects.
The team has a developer who—for some legal reasons I would prefer to keep undisclosed—cannot be fired. The problem is that this person doesn't perform as well as expected, due to personal problems. While the person has the required skills, an personal event made this person psychologically fragile, and his integration within the team is very difficult. Here are some of the problems encountered:
He is unable to perform some of the tasks and spends a huge amount of time performing others. For instance, two weeks ago, he took a task of implementing a rather basic feature¹ of the project. One week later, it appeared that he is unable to implement it, so another colleague took over and did the feature from scratch in two hours.
Despite all his efforts, he creates a lot of bugs in his code. I worked with him personally to explain how to unit test the code, what tests are relevant and which ones are not, but I failed. For instance, he is still not testing more than a half of the edge cases.
He is reluctant to perform some basic tasks expected from any developer. Two are especially annoying: he doesn't commit his code often enough (usually he stays from one day to seven days without doing a commit, while his colleagues are committing at least twice per day and often up to ten times per day), or he never writes comments in her code.
He creates regressions when modifying others' code, and often can't figure out how the code should be fixed. Frequently, he ends up being helped by the original author of the code, wasting a lot of time.
He barely speaks with her coworkers, making team communication difficult and awkward. Being depressive, he also takes a lot of things personally, which means that even a question such as “Have you finished implementing this interface?” can (and often would) be taken personally, and will be answered in a very defensive way.
During the meetings,she practically doesn't participate, and also takes everything personally. For instance, during the last weekly meeting, the manager was asking why a given feature was late. While the feature was completely independent of his work,² he still perceived it as a personal blame (note that this manager never blames anyone).
Code reviews are absolutely out of question. The team tried pair programming with him, but failed.
Unfortunately, he not only harms herself, but also the team morale both during the meetings and the daily work. A week ago, his colleague (who also appears to be the most valuable developer in this company) talked informally with the CEO, telling that he can't work in this environment any longer and will leave soon if the management doesn't take a firm decision. I'm afraid other developers will soon start searching for another job too.
[Sentence explaining why the person can't be fired removed]
We (the project manager, the CEO and I) also thought about:
Another job within the company for this person. Since the company deals with manufacturing requiring special skills and other jobs (accounting, legal affairs, etc.) also require specific skills, this is not a solution.
Get help from a psychologist. It appears that he already consults psychologists for several years, so I hardly doubt her lack of self-esteem and her communication skills will improve this way.
A development-related job which is technically simple and requires no communication skills. The problem is that it's difficult to come with such job and will affect negatively his self-esteem.
I recently suggested another alternative: let the person work remotely (from home) on low-priority tasks assigned to him directly by a manager. This would prevent him from affecting the team, without lowering his self-esteem. The CEO is currently discussing this alternative with the lawyer.
Are there other alternatives?
More generally, how would you manage a psychologically fragile employee who actively (but unintentionally) harms the team, but cannot be moved somewhere else, nor fired?
Note: if it matters, it seems that I have a privileged relation with this developer: while he barely speaks to his coworkers or his manager, he seems to trust me and talks to me. The fact that I don't work in this company and intervene in an informal way, as a friend of the CEO, may be the reason for that.
¹ The feature consisted of implementing LESS minification in an intranet website. Not straightforward in the context of an actual project, but still not particularly difficult; I would estimate the task at one to four hours.
² The feature was purely on client-side, that is JavaScript with no reliance on server-side components. The developer works exclusively on server-side part of the project.