Why not take it at 5 when you start your eating window? - may not have much of an effect on your sleep at all, but it will change the effectiveness.
https://www.healthline.com/nutrition/best-time-to-take-vitamin-d
As for the second part, my understanding is at best that stuff only really matters when training at the highest level, like the Olympics, and some of it is just gym science or designed to sell you products. Last research I saw was that hitting your daily intact goal was most important and timing made little difference, though that had more to do with if you needed protein right after a workout as opposed to spreading it out. But the r/leangains sub might be able to offer better insights on this topic.
Wow I didn’t know this about Vitamin D
Is it not recommended to take at night since is halts melatonin production?? I take vitamin D nightly. Wondering if that interferes with my ability to go to sleep and stay asleep….