I used to work rotating shifts (mainly second and third with a few firsts thrown in randomly) and ate the typical Standard American Diet that included many convenience and fast foods, sodas, energy drinks, alcohol, meat, cheese, eggs, etc. I, too, had insomnia like a mofo and was prescribed xanax to calm me down when I got home to prepare for bed, then ambien to go to sleep, and was advised to take more xanax or another ambien if I couldn't stay asleep.
My doc was never comfortable prescribing other sleeping pills besides ambien for some reason. Then I read that ambien shouldn't even be prescribed at that high of a dose for females (10 mg) and started trying to figure out other ways to deal. No wonder I felt so damn sluggish and drained all the time, eh? I was experiencing many severe and unpleasant side effects from other meds also being prescribed at the same time, too, and was getting fed up with being their guinea pig while things were greatly and steadily worsening.
Had a sleep study done that indicated no issues of concern. Struggled for years, still, until I finally resigned from my job, moved to the woods, practiced breathing on purpose each day, totally changed my consumption lifestyle ( no more meat, dairy, eggs, caffeine, or alcohol) and made it a point to purposely move my body each day on the mini-trampoline, out in nature, dancing to favorite jams, or with my hula hoops. Drastic, yes, but quite effective.
I now fall asleep by midnight, most nights, and am up with no alarm by 8ish each morning. I rarely ever wake up in the middle of the night anymore unless I drink something too close to bed time. I also no longer feel the need to nap each day. I used to depend on naps as an escape of sorts. It was the closest I could get to death without the commitment, so I stayed asleep A LOT every chance I got, which was always at times other then when I needed to be asleep. I remain amazed as I thought I'd surely be plagued with poor sleep my entire life. Many things I'd thought I was simply "stuck with" via genetics, aging, or circumstances changed when I changed what I consume. What I used to consume was consuming me, instead, it seems. Wishing you the best in sorting out what will bring you the healthiest and most sustainable relief.