Sleep issues can be caused by more than just biological or physiological reasons. The reason can also lie in psychological disruptions. In this case, medicine only masks the symptoms of the real problem.
I would offer this consideration for lack of appropriate sleep in situations such as these. The cause may be an internally persistent fear, or more likely a set of dynamic fears that feed on each other.
Fear can come in subtle forms. Not just the fear of war or the fear of something animate.
Examples may include the fear of deadlines. The fear of meeting performance requirements. The fear of what other people may thinks of you. The fear of consequences of things you have no control over.
Sometimes the biggest fears come from the fear of something out there you don't even know about ... yet.
These fears could create a circular mental loop, which runs endlessly in your mind and spirit. And this constant drain of mental energy can be putting an enormous demand on your bodies ability to manage the "non-fear" real issues of life. Having good health and maintaining a healthy lifestyle may provide more than enough energy for your mind and body to meet it's daily demands. But the running of these constantly running, fear based, "error loops can consume more than you can possibly muster, even with a well-balanced lifestyle.
And the reason could be because the nature of these fear loops is not "static" but "dynamic". By this I mean, perhaps when you force sleep with medicine or exercise more and eat more, this loop finds new and more issues to run to use up any new available energy.
Our bodies have certain functions that are considered "autonomic", such as breathing. I read a book recently on neuroscience that referred to these "autonomic" processes as "zombie systems".
Your body will run these systems regardless of your consciousness. You don't decide to breathe, you just do. Remaining energy is available for conscious thought and action, including learning. If the remaining energy is consistently drained by the "fear loops" or "error loops", it stands to reason that you will not have enough energy to apply to conscious thought and behavior. Perhaps the mechanism that the body has to shut down this unnecessary taxation of energy is to shut the system down: sleep. And this disruptive energy tax may not allow for normal cycles of shutdown, but instead require both extended periods of sleep or periods during a day that are out of the natural cycle.
Identifying these energy takers could be a big first step. That includes, especially, the many small ones. You could have on major energy tax consumes, say, 50 units of energy a day. It is obvious, so you attack that. What if you also have 10 other energy taxing situations that only consume 15 units a day. They would be easy to "overlook" or "underestimate" in comparison to the one that requires 50 units by itself. But the combined effect of these "smaller situations" would add together to constitute the drain of 150 units of energy, which is 3 times the amount of the one big one. So it would be important to evaluate them all.
Calming the mind and releasing the fears could have the effect of making available an enormous amount of energy that can result in much heightened mental acuity and quality of life. You may find that the increased performance itself resolves the issues you spend so much energy on now. And consider not only the benefits to your life, but to the lives and quality of lives of your family, friends and others.