I know a competent dev with severe mental health issues (bipolar, manic depression, ASD and narcissism all combined and untreated) who has been fired over 10 times (no exaggeration) but keeps getting jobs rather easily with a high salary.
Getting fired once because of this is not the end of the world if you're sufficiently competent. I don't have any practical advice but hopefully that keeps your spirits up a bit.