One very consistent pattern with vitamin D research is that association studies will find a major relationship between serum vitamin D and some health outcome.[1] But an RCT using vitamin D supplementation will find no effect.[2]
That strongly suggests that serum vitamin D, at least as we measure it, is merely proxying for something else. The map is not the territory. There's an X-factor that's related to serum vitamin D, but is not just serum vitamin D. Artificial supplementation doesn't work. Since the vast majority of population vitamin D variance is related to sun exposure, that would strongly suggest that sun exposure is the X-factor that improves health.
[1]https://www.cambridge.org/core/journals/proceedings-of-the-n... [2]https://jamanetwork.com/journals/jamacardiology/article-abst...