While in general, exercise is great for mental health, it's absolutely not a cure all.
I tried for over a year to run consistently. I did it every other day to every third day for over a year. I didn't get anything positive out of it. People kept saying you're just not running fast enough or far enough. So I pushed myself further and further to no avail.
It wasn't until I stopped running and found a different sort of help that I finally improved. I needed intensive therapy and medication.
For me, exercise doesn't help unless it's both physically AND mentally engaging. So for example, choreographed dancing has helped me because it both engages my body and mind to where it's hard to think of much else.
Most forms of exercise are far too simplistic where it is easy for the mind to wander elsewhere imo. Yes, I can be pushing full out and still think other thoughts if the activity isn't as mentally engaging enough.