Writing as someone coding professionally since the early 80s, in project teams sizes from 3 to 10k, and at the highest primarily engineering position I can achieve without becoming a non-coding manager (Systems Architect)...
As engineers age, they may gain experience, but productivity does often drop. We also have those pesky families and/or work-life balance goals. And an unfortunately repeating pattern for engineers is reaching a point where they now think they know everything they need to, and learning grinds down, sometimes to nothing. If they only work on legacy code that might be OK if no innovation is required. Domain knowledge is difficult to quantify the value of, and varies greatly by organization and project, and I would argue that all seniors should work hard at making sure this is clearly documented AND passed down.
Most companies are happy to keep a few older experienced engineers around to try and direct teams of young high productivity programmers (no family / life, willing to work 60-100 hour weeks) and attempt to mentor them to make less mistakes. Increasingly these teams are in low cost regions, most commonly India.
I would begrudgingly agree that in most cases, in terms of a cost / benefit analysis of 'value to the organization / stockholder', which is what really matters, this is true a statistically significant percentage of the time.
Of course, most of the time comments like this are merely the result of a HR directive to cull expensive engineers to reduce payroll and make room for more low cost region 'resources', driven by a suit that doesn't understand the full value of their older engineers. Unfortunately we live in a world where most important decisions are made by MBAs without a clue. Older engineers must learn to make sure the layers above them understand their real value to the organization.