GP's point and your own are not necessarily at odds. A lot has to do with which real lawyer is used as representative. Are we looking at average experience, median, 76th percentile... Taking into account those who never started practicing, etc.
The same can be said of other professions, but the details vary a lot. Relative merits depend on where we put the probe.
A well to do lawyer, 40+ lawyer can be in a more comfortable career place than a comparison programmer going forward. Tech careers "naturally" progress into management, whereas lawyerly one progress into seniority. Competitive, yet prestige based career starts. A nice seniority ratchet as a winners reward.
OTOH, scrapy starts seem like a tough place for lawyers. In tech, skills, hustle and attitude can get you a start... when times are good. Tech is a good business to be in, but volatile... even when times are good. I wouldn't say only chops matter, but you can get by on mostly chops.
Play the game you stand to win, I suppose. If you are en route to line up prestigious degrees, internships and such... 1 in 4 doesn't necessarily mean 1 in 4 for you. There's a harsh distribution.
I suspect this explains attrition. More prestige oriented success factors and a harsher distribution. Beyond a certain threshold winners win a more prestige oriented prize. The 44 year old senior programmer probably has a less cushy path forward. Seniority isn't even a value, it's only valued for implied experience.
If you have good odds at a prestigious internship or starting job, it makes a lot of sense to pursue law. If you aren't, it often won't. I reckon that reality sinks in during law school. Programming doesn't really have that. False starts, scrappy starts, and such are fine. Average results for working programmers are fine. An uncle who can advise and groom you before eventually recommending you for a great internship is great, but it's not the stuff most tech careers are made of.