Let's look at the "too harsh on yourself" part. So you're not the founder of a Unicorn startup that you started in your dorm room at an ivy league college. You know what that makes you? It makes you a perfectly normal person who has decided to follow your entrepreneurial instincts instead of getting the development version of a McJob. That's highly commendable.
It also may have not worked out in the way you wanted it to work out because you're not filthy rich and cruising around on a Megayacht (or whatever else your dream is). That is the case for most entrepreneurs - my first endeavour bombed so badly I ended up paying for it until about six years ago (ie, for over 10 years) after the lawsuits and and the other not fun stuff. But I also gained something extremely valuable called experience. I've since had a couple of other companies that made money, and it actually made me more valuable as an employee because I learned entrepreneurial skills that I wouldn't have otherwise.
Not being an overnight success is actually an advantage in my book - the lessons you learned are important and will massively increase your chances to succeed in the future.
One thing I've learned over time is that you need balance in your life, and you can only achieve that if you do more than one thing. To me it sounds like you've poured everything you have into a single vessel (work) and now that work didn't provide the results you expected, you're staring at emptiness because there isn't anything else.
So, first advice is to find something else you're interested in and give it some time in your life. Don't try to make it another business, but something you expressly do to counter your 100% concentration on building software. That'll help you with the burnout for the simple reason that it allows you to switch of the "tech" part of your brain.
In my case, I work on cars, I build track cars for myself and I do use them as intended. I'll never make a decent race car driver but that's not the point - it helps me balance my life, and it scratches the itch of creation and gets me away from computers. Same goes for the other things I do away from development like gardening and reading non-computing books.
BTW, you're not too old. Nobody ever is.
That said, I am toying with the idea of doing something non-software for the next 20 years or so simply because it's getting to the point for me where very few companies are willing to pay for the sort of experience and craftsmanship I can bring to the table. So I'm developing some other interests that may or may not turn into a second and third career.