The reality is that someone switching to software development mid-career is going to have similar programming knowledge to anyone else who has never had a programming job before. If they’re willing to truly accept going back to junior status with junior pay and defer to team leads and managers who might be younger than themselves, it’s not a problem.
But that’s easier said than done for a lot of people. It’s hard to go back to being a junior and it’s hard to be managed by someone much younger than yourself. I’ve worked with a lot of great engineers in their 50s who had no problems reporting to someone in their 20s, but I’ve also worked with some grumpy old guys who wanted their 2-3 decades of work experience to be the trump card in every dispute.