If you let yourself get that specialized then you're always going to be one or two innovations away from a layoff. I kind of feel that anyone who inhabits a niche like that for a long time is going to be in danger of becoming a victim of their own comfort seeking. Our industry is not kind to those who don't continually challenge themselves and learn new things. As a counter example to your friend's situation, I'll be turning 58 this november, and I'm an SRE/devops engineer working on kubernetes-based infrastructure in google cloud. Five or six years ago I was a back end .NET guy, a few years before that I was doing ASP web apps. Before that C++ and COM/DCOM stuff, and before that Orbix/CORBA, and before that... you get the picture. The old saw is that nothing stays the same, so if you're not moving with the world you can be sure it's moving past you.