The protecting nature of professions that involve impacting the life of an individual such as the healthcare, aviation, transportation etc is indeed justified. I would need very strong qualified AND certified candidates if the requirement was to write safety-critical software that ensures the safety of humans or animals; especially in self-driving vehicles.
Startups in the tech industry can easily undo mistakes or revert it, along side bootcamps training up anyone to make a career-change into the profession. Doctors cannot afford to make mistakes that risks danger to life. Thus, they require years of training/studying in medcial school to become fully qualified.
So yes, eventually eveyone (including doctors, lawyers, etc) will have the perk of being able to write code and will assist in the automation of their jobs, but not exactly absorbing or replacing their skills.