Grass is always greener, but we have it easy in software and it's good to remember that.
All that said, I've been through the types of discontent that OP mentions. I've worked many interesting software jobs, started multiple businesses, failed many times, succeeded, made lots of money, shipped an indie game that was an expression of myself -- a dream come true, and at the end of it all... emptiness and a feeling of not-enough-ness (not depression!).
If one does not find a philosophy that accepts this as reality at its core, you'll be chasing your tail until the day you die. I personally prefer Buddhism without the ceremonial pomp, and in that vein I'd recommend Noah Levine: https://www.againstthestream.com/dharma-talk-and-meditation-...
Edit: 100% agree though that giving back to people is wonderful. Some of my best experiences have been the happiness in helping someone else succeed.