I know exactly what happened. Changing languages and domains every few years can wear you out. If you were lucky enough to pick one language that madw it 20 years you can spend your time deep diving different domains. Bonus if the language becomes unpopular with developers but still need with business. Bonus points for picking a fun language you like.
A real pain is leetcode.
I would certainly agree that your best shot at maintaining your passion would be to stick with 1 or 2 languages and get really good at them. Constantly context switching does wear on a person.
With that said, there are some caveats...
1) Businesses need to find that language useful and important. In other words, there must be opportunities to make money using that language.
2) The language must support great depth of work. For instance, learning Objective-C or Swift could become dry over the years as you master the iOS SDK. There's a lot there to cover, for sure, but I imagine after 10 years you might arrive at the same endpoint: Somewhat deflated, certainly less passionate.
3) The language must resonate with you. Everybody has a language or a programming style they enjoy. Personally, I love classic, imperative, low level stuff. C, C++, even Java. Not really a big fan - despite years of professional work - of declarative UI, or functional programming.
I'm curious since you have 20 years - what language / domain have you been focussed on? How did it work for you?
I started with C/C++ so php was natural fit.
A good question would be if starting out today what language would I pick?
I'm tempted to pick php but I would probably go for react. The market is huge career-wise, the language is fun to develop in and the community is strong.
Some solutions in PHP are quite elegant that are quite not in virtually any other language. Like WordPress’s priority queue (aka, hooks).