Lawyers will not commit malpractice because they would open themselves up to liability and damage their professional reputations.
In contrast, most software devs will code up whatever evil garbage features their bosses tell them to. They don't even have a concept of malpractice. Very rarely, one might quit, but they have no standing to say "no" to their employers and remain employed.
Michael Cohen had a law degree, dude. Christopher Duntsch had a medical degree. It's just people. They're not gods because they have some degree.
And that's only the named people. I don't know how many people you know in medicine or in law.
If you're unfamiliar with things being upcoded or out of network doctors substituting in late and then having patients incur massive fees, then maybe it's best to familiarize oneself.
And there are lawyers who specialize in getting the right rich guilty people out. The Razor didn't get the name by chance.
Why are you comparing coding up dark pattern feature to the malpractice? It's more comparable to, e.g. a patent troll's lawyer drafting a letter intended to bully a troll's victim into paying out of fear of litigation costs. Or reviewing a forcing arbitration agreement that a company intends to make all its employees to sign. Or other things that can be considered morally 'evil' but completely legal and wont get anyone sued for malpractice.
In contrast, most software devs will code up whatever evil garbage features their bosses tell them to. They don't even have a concept of malpractice. Very rarely, one might quit, but they have no standing to say "no" to their employers and remain employed.