This sounds very similar to where I was a few years ago in a different job. At that point, I was 5 years into a company where I loved my team members and the people that worked at the place generally. But at the end of every day, I would come home feeling like I let everyone and myself down for not being engaged enough or getting enough work done.
If I'm understanding the things you're feeling in your post correctly and if you have access to one, I would highly recommend a therapist to help navigate the things you're feeling. They can help identify why you might be experiencing these things and to help come up with a plan to help move yourself into a better head space.
For me, what helped was to move my career towards my goals. I was doing sysadmin work and I wanted to get into web development. Now that I'm doing it, I'm incredibly happy but still worried that I'll experience that again.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.