It doesn't really have anything to do with after a certain age, either. Some percentage %x of your 5 year experience programmers haven't really moved much past their first year at all.
To be fair, I think of it really as a series of plateaus, not a hard and fast rule. People get stuck at a level of professional development for all sorts of reasons, internal and external.
The thing is, it gets more noticeable the longer time period you are talking about. Comparing two people with 3 years experience where one of them hasn't really progressed past the first year or so, and the other has 3 solid years is a lot different than comparing two people with 30 years experience where one of them hasn't really passed the 10 year mark of development and the other has a solid 30.
And "useless" is the wrong way of looking at it. There is a lot of use for a developer with 5-10 years of experience, so long as you don't expect them to perform like a developer with 20-30 years experience. This is true even if they have 30 years on paper, which can be a bit of sticky point w.r.t compensation, but that's a different issue.
This absolutely happens with lawyers and doctors, by the way. A real difference is that a doctor has been forced into a good 10 years of professional development before they take the training wheels off, so the base level of competence is much higher. Some of them don't progress significantly beyond that for the rest of their careers, but that doesn't mean they aren't productive for that whole time.
As an industry, I do believe that software development is pretty weak on developing talent internally, particularly beyond the entry level.
But I've always thought a team of generalists beats a team of specialists, which is swimming against the current tide.
Considering nearly any situation your team encounters, junior people, experienced people, and very senior people are likely to take different lessons for it, because they have different perspectives on what happened and what could have/should have happened.
To me, a "same year of experience, 30 times" person is someone who runs into similar situations over and over, but fails to grow in how they understand and react to them. This is true of architectural issues, interpersonal issues, schedule management issues, ... everything really.
Technology stack isn't so important here. If anything I expect the experienced people to pick up a new stack faster, if they've done this before, all else being equal.
I'd expect insight and ideas from a 20+ year developer I'd never dream of asking a junior (< 5 years), and if you don't get them - you're probably looking at someone who has repeated many of those 20 years.