Apropos of anything else, the 'lawyer' example is a bad one, and contrived for the purpose of example.
If an attorney "knows" that their client is guilty, they are duty-bound as officers of the court to make that knowledge known.
Obviously that doesn't happen as much as it should...