Agreed.
However, even if they were in the wrong, they obviously wanted you gone, for whatever reason. Take the hint, but do it with as much benefit to yourself as you can. If you can, to salvage any severance benefits and at least a non-termination job separation, get a note from the doctor that treated you (these are legitimate), get your employment restored, then quit with any remaining benefits you are eligible to. That way you can also say you quit your last job. Every application you ever fill out in the future will ask have you ever been fired, and no matter the story it is a red flag to a future employer.