I don’t think I can answer your question very well. But I do know it’s common with depression, or could be diet related, and as Seth said, yes, there is a cycle. It can take some determination to break out of that cycle. I have found what often works (and incidentally what works well for completely shifting a sleep schedule) is to begin sleeping anytime you’re tired but only for a maximum of 2 hours (even a few minutes can be quite revitalizing). So your day/night quickly turns into a a series of successive short naps.
This gives your entire circadian rhythm, sleep toxin (not the best word as these are in essence intentional toxins) situation suddenly great flexibility, and then from this flexible pattern you can ease into a sleep pattern more to your liking. (A weird analogy is think of breaking your sleep up into pieces to fit through a small spot, and then reassemble on the other side.)