> My performance never dropped, only my communication.
Unfortunately, your communication is part of your performance as a remote employee. If your communication with them diminished to the point that they were unable to communicate with you as necessary to complete your job, that's grounds for dismissal. If you continued to write and submit code while failing to acknowledge communications from the company, you may have demonstrated that you were capable of working yet avoiding communication, which is part of your job.
While I'm very sorry for your situation and I can empathize with your struggle, I have to be blunt: It's not clear that you have a valid standing here.
For future reference, any sudden absences should be communicated to your employer ASAP. You don't need to provide details. If necessary, you can have a family member send a short communication (don't provide any medical details, just explain that you are unavailable due to medical emergency) to your employer.
I would also recommend that you read up on what constitutes reasonable accommodations under the ADA. Be wary of internet sources, as this is a nuanced topic. Generally, though, these situations are more appropriate for taking leave under FMLA.
> If you know a lawyer that can help me
Again, please be careful. While it's tempting to pursue legal action, it may cost you more time and energy than you can spare to fight a battle that you are, frankly, likely to lose under the circumstances. Unless you can identify a specific legal violation (not conjecture about their motives) while covering all of your bases, it's better to focus your limited energy on returning to good health and moving on.