Yes, this happened to me a few years back. I had been riding regularly for 4 or 5 years and lived for riding @ the weekend.
Then one Saturday I got up, got my kit sorted, bike sorted & was just about to go riding when my wife came home. I just put my bike away got changed & vegged out on the sofa 😕 No real reason for it I just lost my mojo.
I had a few weeks off the bike & did other things but none gave me the buzz I got from riding & once again I returned to my regular weekend rides.
I echo what was said above in that geting some cheap lights & going night riding is the dogs bollox and the sooner the clocks change the better.
Maybe give riding a break & try other things. If they don’t float your boat then go back to riding. Find some riding buddies to add a bit of peer pressure to get out on the bike. Do fun rides rather than XC race type rides.