The NHS does recognise vitamin D deficiency as an issue.
In the UK, a science advisory body (Scientific Advisory Committee on Nutrition) published a 300 page report of the evidence on vitamin D and health in 2016. Their conclusion: adults and children over one in the UK should have at least 10 micrograms of vitamin D every day. For some people this may mean taking a vitamin D supplement. People who have a higher risk of vitamin D deficiency are advised to take a supplement all year round.
Here is an overview of the guidelines on the NHS website which includes a link to the 300 page scientific review.
https://www.nhs.uk/news/food-and-diet/the-new-guidelines-on-...
However, the specifics do matter; see e.g. https://www.gwern.net/zeo/Vitamin-D - this is n=1 but consistent with many other n=1 self-experiments I'm familiar with; personally, my sleep is improved with increased protein consumption AND 10,000 IU D3 before 10AM (Both contribute; I've not gone about 10,000 IU, but 5,000 UI has a much lesser effect)
I have not find a peer reviewed time-of-taking-D3 paper when I looked, but D3 is recognized as a timing mechanism ("Zeitgebber") in many papers I've found.
So while you not everyone who is feeling tired or depressed will have a vitamin D deficiency, I'd say that it absolutely can cause those symtoms.