I haven’t figured out how to have great sleep hygiene myself, although I am trying.
But I wanted to comment on the psychological aspects. I have had phases where my sleeping pattern resembled yours, usually because of similar feelings of inadequacy at my job and sometimes because of other life pressures. My sleep during all of December was a mess, because I was processing my mom’s recent (serious) cancer diagnosis.
I don’t know you personally, so please take this with more than a grain of salt. But the way you write and the fact that you are on TR indicate to me that you have very high expectations of yourself and you are used to succeeding. I wouldn’t be surprised if others considered you very successful, it is just that your yard stick for success is different. Say, you are a mediocre NBA basketball player. You’ll never make MVP, but you’re there, putting in your hours. Are you successful? When compared to Kobe Bryant, Michael Jordan or Dirk Nowitzki, nope. Failure. But just making it into the NBA is a huge thing that requires a combination of talent and hard work. Huge success.
I don’t know how much of that applies to you, but try to check whether your yard stick is right. If you feel like you are in a bit of a rut and you feel trapped, try to find other options for yourself. And don’t define success solely by how successful you are at your job. Don’t forget family, friends and hobbies, if you eff up at work, you can still be a great partner or father. You can still help friends who need it. Opening my mind to these broader criteria for self worth have helped me. That and eating better and doing sports (i. e. cycling).