The problem older programmers face is that the world as-is still defines engineering as a subordinate role, and people know from experience that it usually ends badly when an older person has a younger boss. Maybe it "shouldn't matter" in some PC fiction world, but in the real world we actually inhabit where people are primates, it matters a lot.
Just as tall women and short men are "diagonalized out" by being contrary to society's expectations regarding height in coupling-- there are much more politically incorrect diagonalizations in dating, but I'll side-step them-- young people don't often get to manage (even if they could) and old people are disqualified for subordinate roles. The business world invented advisory positions for this purpose (the semi-retired older employee is effectively non-subordinate, because he doesn't need the job to retain an income, but isn't a full-time executive). That's how it finds a use for active older people who are ineligible (often because they just don't want it) for full-time executive positions but have extremely valuable experience and relationships. Advisory positions keep skilled older people from being diagonalized out by the traditional subordination model.
What's needed to fix this problem is for engineering to become closer to an advisory relationship than a subordinate one. If engineers had the level of autonomy seen at places like Github and Valve, age wouldn't be nearly as much of an issue. Right now, people look at a 55-year-old code monkey as a chump-- he's that old and he's still taking orders? But there is absolutely no reason why a 55-year-old can't program; it's the subordinate context rather than the work that is the problem.