Seems going into IT may be more financially rewarding for someone later in career. OP could probably more easily pivot to being an application SME for something fintech or maybe mech-E related than a SWE.
But I am curious myself too. I’m hitting 40 in a few years and will have 10 solid years of IT at that point. Programmings always been something I’ve dabbled in on the side. But I know that market has ageism probably stronger than in IT.