The median age of 42 just means a lot of sore 40-somethings can’t afford to quit yet. Age alone doesn’t tell you how their knees and backs feel after 20 years of rebar.
Not sure how many people you know in the industry but most architects, managers, etc... are 40+ years old. Not even remotely difficult to get hired as a senior engineer, way more in demand than 20 years old devs