Hello and welcome to this forum!
I am sorry to hear about what you are going through and I am no expert. You are taking simple nothings and mundane things way too seriously! And this is often the cause of suffering. People are taking what’s going on in their lives too seriously. Essentially what is suffering in life? It is simply because you want things done your way, you get obsessive and you want to be in control of everything, all the time. When things deviate or you don’t get what you want, which invariably happen, you take it too personally and get too upset over them. Even things you have no control over. Like sleep, your dog licking its feet or being in an accident in which you weren’t driving, years ago!
I can’t speak about other things. But sleep is something nobody has any control over. Ever. Even when it seems like you do. Sleep is a core biological process that happens or accumulates after being awake long enough. It’s like being hungry after being starved for a long time. It’s as simple as that! There’s nothing complex about it. So it’s futile to attempt to conquer it, via meds or other things. All those things you do never really affect sleep, your body is in total control all the time, and it decides when you fall asleep or how much you actually get. It was your own body that made you sleep this whole time, not those meds! When you do something to sleep, the results are often mixed because there is really no connection whatsoever and whatever outcome you get is just by random chance.
The kind of personality you are is often a factor. Try to practice letting go bit by bit everyday. The world and the people around you will still go on despite you not doing the things the way you want them. So it’s really not a big deal! Don’t judge everything especially your sleep. Be okay with whatever you get. Just get in and out of bed at regular times. You may want to discuss with your doctor how to taper off those meds. If you watch Martin’s YT videos, there was a lady who had insomnia for over 60 years, took sleeping meds almost all her life only to discover her natural sleeping ability is always there the whole time, via CBT-i. Whatever connection you make between your sleep and taking meds exist only inside your head, these connections aren’t real or reflect reality. Good luck!