There have been a lot of post floating around the internet with various solutions, the most popular being Stoicism > Positive Psychology / Happiness research > Buddhism / Meditation. I've dabbled a little in all of them and they all have something to offer.
Essentially, you are experiencing a disconnect between how it feels to be you and how you expected to feel. As someone only a little older than yourself, I would say this: your job will never love you back, and especially in the software realm, it may not be as fulfilling as something like woodworking or therapy. It does pay the bills, though.
The above mentioned happiness research / positive psychology suggests that having multiple, meaningful social roles that you can fulfill outside of work will allow you to shoulder more responsibility and find meaning in your life.
What I'm trying say is that in the second half of life, it is our job to give back. So start there.
Also, this is in my morning bookmarks to revisit: https://old.reddit.com/r/AskEngineers/comments/so6e8h/engine...