The problem I typically see isn't that someone focused on a technology for too long and became unemployable. It's that they focused on an employer for too long and became unemployable. I started my career doing C and sql 20+ years ago. I could still easily make a living at them if I wanted. My second major technology was enterprise Java. I could still make a living at that if I wanted (and to an extent, I still do).
But people spent 10-20 years in a culture. They don't know how to even look for a job anymore. Their skills may be great, but they've never put in a job application online. They're unknown to the recruiters. They don't know how to write a good resume that reflects their abilities. I watched my wife go through it last year. Laid off after 15 years at one company, her problems were twofold. First, she had narrow but deep domain expertise. Second, she was rusty at job hunting and out of touch with industry standards that had evolved without her. She still believed in waterfall and thought agile was a joke - not good for someone looking for product owner roles! She learned, but it took a while.
Programming is a young field. It's changing dramatically from year to year. My first paying job was writing FORTH code. At one point I was writing OO C code on an embedded platform because we didn't have a C++ compiler. Eventually I became an expert in C++ (like an actual expert). A few years ago I went to a job interview and they asked me questions about Boost. I had to tell them that back when I was an expert in C++, the STL hadn't even been written. We were all using RougueWave. I've been paid to work in Perl, Python, Java, C#, Ruby, Go, Javascript and several other languages you will never have heard of because they were proprietary languages written by the companies I work for. I've built embedded systems, real time systems, distributed systems and now I'm trying to fix 10 year old Ruby on Rails code.
The thing is that none of the stuff I do is really all that different. It's just the details that change. Every time I learn something that is truly different, I always find a way to apply it to what I'm doing (if you look above you will notice a huge hole where functional programming should be... it's getting filled).
This field is about learning every day. If you want to be more than average and you want to stay that way for more than 10 years, then you have to accept that you will be spending all of your time learning. And making.
HTH!