There’s a good chance the company will be scared to fire you, since you can now claim they let you go because of your mental health. Especially in large corporations where it’s not worth the risk of being sued.
I call it “playing the crazy card” and it paid for my beach house.