While in general it might be true that high risk comes high reward, in programming languages it may also be just a dead end. You mention several the of the success stories (like Java). I would argue another approach… hedging your bet, is a better way to go.
If you see a new language or technology that you think is fun and would stretch your mind, invest your time in it. Not for any kind of reward of getting a job using it, but for the enjoyment. When it comes to investing in your skills for the job market, like financial investments, it is better to wait and see what the market is doing, do a little research and make your bet in something more sound.
Computer programming languages come and go like the seasons and are cyclical like the seasons too. A few languages last through time (Java, C/C++, Python etc.) but most come and go. Play with languages in season if you like, invest in languages that endure and when a language starts going mainstream and lasts a bit of time, then sure grow with it.
Now, as for your example… the buddy who chose COBOL or C in 1995, he probably would actually be pretty rich right now. The fact that many legacy financial systems can still be using COBOL, finding devs that know that language is in high demand due to scarcity. As for C, C is very much in demand for driver development and low level “bare metal” applications.
But I digress… Java, Python and PHP are all languages that have endured and will continue to endure. Invest in those all you want. They are part of the “Fortune 500 of programming”. JavaScript frameworks however are often seasonal. The language endures, the frameworks do not. React is one of the longest lasting I have seen so worth taking a look, but the rest will probably fade away over the next decade to be replaced by better frameworks and ideas. That is just how it works… which is fine.
As for where all this is going, don’t look at the languages or frameworks, look at the technology trends. Big Data, AI, facial recognition, quantum computing, Internet of things etc. are going to dictate what stays and goes. Python is a big player in many of these fields and so is Java.
Just like the financial system, look at what people use, buy and need. Then invest your skills in the things that help you deliver those… not fad stocks.