Sorry to hear this OP. I can only imagine how hard you must have worked to even be in the position you're in right now and to have doors you've dreamed of and worked towards for the majority of your life now (seemingly) shut. I think @xxfan624 answers your question about whether or not to pursue fourth year the best. I'd like to elaborate more on this difficult process. First, it's unclear as to what job you're considering. You say " People tell me there are jobs in pharma for MDs but I'm not sure if this is really an option" and "what kind of job. consulting is out of the question", so what exactly are the things you are looking to possibly do? I am not asking rhetorically, I really can't tell if you are not considering non-clinical careers or if consulting is out but pharmaceutical rep is in? If you could be a bit more concrete, that would help us help you.
Couple points:
1.) Turns out there is an entire website targeted to people who have strayed off the traditional MD->Residency/Fellowship->Attending path:
Look for Zebras | The guide to a fulfilling life for physicians and medical professionals | Look for Zebras. Don't get too excited. At first glance it looks pretty thorough, but the more I look at it, the more it seems to be mainly someone else's gig and way of selling their book dedicated to careers outside medicine (which I'm guessing is their career outside medicine). That shouldn't stop you from mining whatever free information you can from it and consider buying the book if you like what you see there (I'm not associated with the site). The site also includes a "non-clinical careers quiz". I took it myself and did not get an option that made sense given the options I picked so I'm not confident in its utility as a decision-maker, but it may give you some general ideas.
2.) You need to talk to people. That's the only way you're going to learn things. The best opportunities are never advertised or else they'd be common knowledge to everyone. COVID makes in-person difficult, but the upside is that less-stressful and budget friendly virtual meetings are now widely accepted. Start by talking to someone in your specific situation or the best you can find. Reach out via FB messenger or whatever you use. Private message classmates you can trust with your situation and ask them if they know someone in that situation that you can talk to. Be patient and consider everything as this is just an exploration phase. Then, try cold-calling some places that have job offerings you'd be pursuing (for jobs that do and do not require the MD). Don't commit yourself to anything, but try to get a sense of the details.
3.) After you've done #1/#2, try to decide what you want to do and then based off that, decide if you need to do 4th year to keep your doors open or be competitive.
4.) As someone above said, do not let your diagnoses limit you. You have gotten this far. If your desire is truly clinical medicine, find a Psychiatrist and Psych-D/PhD therapist who're invested in you and try to move forward. You may have significant limitations in what you have to do like having a very low stress environment but you should definitely explore these options!
Hope this helps. You will do well.