What I didn’t see discussed was the possibility of the reverse causation. People that have more diseases spend less time outside and therefore have lower levels of vitamin D.
Would explain why vitamin D supplements don’t seem to work in the studies mentioned in the article.