Hiking has the biggest effect though.
I think maybe the problem is that therapists are diagnosing people, and psychiatrists are prescribing pills based on those diagnoses, but neither are ordering bloodwork to check for deficiencies. Which leads to a lot of people suffering from lack of basic health, and treating the symptoms with SSRIs that have withdrawl symptoms a million times worse than most of the problems they treat.
Now to your point, I seriously doubt that vitamin D will hold up against anti-depressants and therapy if we control for other health and quality of life issues. I just think there is a ton of misdiagnosis, and lack of root cause analysis in the mental health field, and health care in general.