There's plenty of reason why it'd be more difficult for a 50-year to learn a new programming language, here's a big one: time
As people get older they have more time constraints and generally have "better (or just other) things to do". This is true for 30 vs 20, 40 vs 30, and probably 50 vs 40 (you could argue that as your kids get older you have more free time but then again people have kids at an older age now). A young person is more likely to be able to forgo those other things and learn the latest transpile-to-js-lang-of-the-week (v2.x).
Sure, people need to be evaluated individually but if I interview 100 people I'd bet dollars to donuts that the older crowd would have less free time than the youngins.