Work is a drug and I seriously think it triggers some sort of endorphin response in the same way that exercise does.
Unfortunately, many white collar types of work are insular and while you are sitting on front of a screen getting a buzz about solving little problems, or even quite big ones for specific issues, the world is moving on.
It is possible that you may even be compromising your career by being good at the technical issues of a job to the extent that some bosses who cannot stay on top of what you are doing may feel they would be more comfortable with a safe, matey colleague than a bit of a strange wizzkid who gets to be known as the oracle of all things.
Fortunately, 47 is still pretty young no matter what the newer generation of employed go getters thinks, and there is life yet to be pursued.
I would say try taking up a sport - gym, cycling, rowing, jogging, or even something physical and competitive. Get the buzz of routine and physical wellbeing and socialising going again.
Then take a deep breath and think about everything that you have learned over the years that can be actualised into real value. The great thing about coding is that it teaches its practitioners that progress only happens from meeting certain logical imperatives - build on that and problem solve your way to another commercial enterprise.
You have got this. The main thing holding you back is your own thoughts.