Apparently D3 inhibits production of melatonin. Can't remember where I read this so not a hugely useful comment but I promise I didn't just make it up! Anecodtally, I've also experienced similar issues taking 1000 IU D3 before bed and having trouble sleeping. I moved the dose to the morning and Boom!, good sleep.
Edit: Here is the study. https://pubmed.ncbi.nlm.nih.gov/23665342/ - only a single study but still interesting