I find that I'm considering this much more now that I'm in my 40s, because I know that as a generalist developer, I will be slowing down in skills compared to the younger devs, so I need to make sure my career is developing in areas that value my experience and soft skills.
I think it's even easier to get complacent with not challenging those soft skills and "tech wisdom" by staying too long in one role.