So Vitamin D deficiency is linked to cancer, heart disease, respiratory infection, stroke, diabetes, and death. But taking it as a supplement helps with none of the above. What is a reasonable hypothesis then? That having an active lifestyle that brings you outside in the sun both causes your Vitamin D to go up, and is correlated with better physical health in general?
e.g. our bodies need sunlight and cholesterol in order to synthesize vitamin D; This process also apparently has some other outputs like NO which are much harder to measure since they get used quickly. It is possible that vitamin D is merely (mostly) a measure of the prevalence of this process, and it is the other (harder to measure) outputs are much more important; Or that it's the consumption of cholesterol that's more important than the production of vitamin D; Or that sunlight has other functions we don't measure that are the important ones. Or that it's all just a correlation to some other process we're not even aware of.
That said, my own experience and anecdotally other people I know (and gwern has some blind n=1 experiments on his site to back this up) is that taking vitamin D early in the morning improves sleep at night, and taking vitamin D in the afternoon/evening reduces sleep quality. For that reason alone, I take vitamin D in the morning, and anecdotally, I burn less when I'm in the sun without sunscreen as well.