Suppose a PhD student got clinically depressed and stopped producing research for a year or two.
What would most PhD supervisors do in this situation? Would it be considered usual or acceptable to stop working with him?
Good PhD Advisors(tm) would first of all talk to the student about the issue. Large-scale depressions need to be properly treated and respected. The important thing is to find out if it is the academic work that causes the depressions and to take counter-measures if it is.
Now if the depression lasts, is properly treated and puts obtaining the PhD at >90% risk of failure and all possible measures have been taken to help the student (both on the professional level and as far as applicable and feasible, on the personal level), then the student is wasting time in academia. And nothing is more depressing than that. So a Good PhD Advisor(tm) would help the student with establishing a new working life that makes use of the degrees already obtained as much as possible. This is basically the best the advisor can do to pave the way to a happier life for the student. I wouldn't call that "firing" someone.
I assume "clinically depressed" means "major depression".
And I assume "fire" means "get rid of as fast as possible".
As a very first rule I'd say, deal with depression as with any other disease of comparable severity. Would you fire a student who had a bad accident and needs a year of rehab? I mean, fire as opposed to think together with the student of how to deal best with the situation.
Secondly, (at least in my legislation) a work contract does come with more duties for the employer than just to pay the wages: typically there are duties of care (? not sure about the correct English term - the German word is Fürsorgepflicht; this covers things like work safety, but also includes e.g. the duty to get an ill employee to a doctor, and about accomodations for chronic diseases, etc.).
I'd say that for depression this would at least include making sure that the student receives proper treatment (don't worry about doing too much: as a third party you're most probably anyways not allowed to do much) and that the student knows the psychological emergency services of your university exist, and how exactly to reach them. In an emergency, do as you'd do with any other kind of medical issue: get the student to the doctor.
Again, I really don't see much difference here to making sure your students know who's the contract surgeon in case of emergencies or attend the company medical officer's preventative screening for work-related health issues, etc.
I'd argue that a PhD supervisor has at least the same duties towards the student as a normal employer. Maybe even more: the student may have agreed to do research on the supervisor's behalf at low (or even no) wage, and PhD supervisors and PhD projects are typically far more is done and difficult to change than a job. Also, remember that agreeing to PhD supervision is not a contract about what exactly is done when, but that a grade will be granted for a corresponding level of research.
Chronic disease/disability may mean that some special considerations need to be taken into account, or possibly that the field of study needs to changed. Maybe even that the profession needs to be changed, as @DCTLib already pointed out.
But this is no excuse for initiating such changes with a kick in the ass.
Consider to help finding a well-suited new field of study if necessary. As in: after accident, student now has metal implants and cannot work near the NMR machine any more => someone else carries out the experiments the student plans and analyses, student switches their focus over to data analysis, switches to other project that can be carried out, etc.
For depression, it may not be as immediately clear what helps and what doesn't. It may be anything from switch away from lone-wolf experiments that need weeks in dark basements to doing things that are in a friendly environment with collaboration with colleagues to switch from computer work to doing more practical work like experiments.
It may also very well be that options need to be tried out. Just as it may be difficult after a severe accident to predict how much and which work the student will be able to do when.
It may also be that you decide you are not able to supervise this student as needed. But maybe you can help to find a new supervisor.
Last but not least, your university may have someone who can professionally suggest what to do - just as for the hypothetical student with the accident. Ask integration office, or the psychological emergency service may be able to tell you whom to ask.
With respect to hat, I sadly have to say that I recommend to any student to get away as fast as possible from a supervisor who thinks about firing PhD students because of a disease.
In a situation like this, I would have a long conversation with the supervisor about what your special needs and requirements are, and make it clear how your special needs (e.g. depression) can have an adverse effect on your work. Stress to your supervisor that if they can adjust their supervision techniques sufficiently well to take this into account and get the most out of you. If they're willing to do that - then best of luck! If they're not - then they're probably not worth working for in the first place.
I do sympathise with you quite a lot, OP. I am a first year mathematics PhD student and I suffer from Asperger's Syndrome, anxiety and depression. These have all had a negative effect on my work ethic and organisational skills and the first year has been an anxious experience for me, as I have been taking rather a long time to get into the mindset of being an independent researcher and only recently have I realised this. My supervisor doesn't really seem to acknowledge this (even though there is a statement of needs on file about me, which my supervisor has seen) - her solution is simply to put more time in. I am going to give this a go but there are other factors which can affect my performance which my supervisor doesn't seem to understand - so one thing I am considering doing is organising a meeting with my mentor, disability advisor and my supervisor just to make things clear. I've thought about leaving my PhD for a while - but I am going to devote a lot more time towards my research and see how it goes. If, after that course of action, my supervisor is still worried but isn't willing to take on board my personal difficulties, and appreciate that they have impacted on my performance, then I might consider switching supervisor or leaving the department.
I find it unacceptable that at such a professional level, hardly anyone in academia is given any sort of psychological training or leadership credentials for dealing with students. You would think that for a job that requires guiding a student through 3-4 years of their life conducting research, that this is a position of high responsibility and not something that socially inept supervisors can treat with a pinch of salt. Although I'm not expecting them to provide therapy or anything like that, general psychological factors do play a part in the effectiveness of someone's research quality and methodology - regardless of whether academics are willing to admit it or not. Academia is a very unforgiving place towards those with mental health issues. This is why academia can be an unnecessary turbulent experience for some students, and (I feel) wrongfully so.