From previous experience of being in a position where I had very severe anxiety and depression due to work place stress and the threat of losing my job (in my case me personally being threatened rather than the team/company) what made me jump ship in the end was when I realised it was making me a crappy dad and boyfriend, I couldn’t let my family suffer for something out of their control.
I left and it worked out ok I took a bit of a paycut but we managed and it felt like a massive weight off my shoulders as soon as I walked out of there.
Now i’m not going go lie and say everything worked out perfectly, I’m a year on from my resignation, my personal life is much improved but I still have things that happened during my “bad period” that i haven’t yet fixed and my current job is also now under threat due to privatisation.
But I 100% do not regret the choice I made, I fear it could have ended much much worse for me and everyone around me had I stayed.
So in my opinion your health and mental well being should be top priority, just make sure you are absolutely 100% certain you are making the right choice before you do it, as only you can really be the judge.