It's kind of awesome & amazing how much better coders work as a team. Doctors are on the line for dealing with patients: they don't consult or make a Patient Treatment Request for every thing they do. Lawyers don't get everything vetter.
But in software we work in teams, and most lines of code get checked over. Most companies expect to be hiring juniors, who, even if they have 4 years undergrad, still have no idea how actually to build software in practice. It's a team effort.
And frankly, at most places, the CS has only a minor bit of overlap with the day to day. I spend more time with juniors flailing trying to understand how Kong and Docker relate than I do with people writing O(N^2) algorithms. Tech has infinite minutia, has endless tech-specific problems we run into. We don't have to train people to be able to take care of anything, to be able to stand alone: we just need to support & guide people who are set up to learn & explore. There's so much twiddling bits until the things start working as desired that experts and novices both have to go through, and just pounding into people's head the idea that it's a journey, that you have to keep going, that you need to look for data (and showing them new ways to read data out) counts more than background, in my view.
It's worth noting that while doctors and lawyers have a long amount of training expected, it's possible to become a registered nurse or any of a variety of paralegal roles in under a year. Unlike these professions, we rarely expect devs to emerge into the professional world fully formed & capable of autonomously leading.