Your observation is why crimes committed by public officials should be automatically raised to a capital offence.
Imagine a court clerk facing a firing squad for pocketing a fifty dollar fine. We'd either have more honest public servants, or MUCH more clever thieves.
Great system . . . it worked so well in the USSR . . .</sarcasm>
A bigger requirement would be a recognition that a government agent's duties require that the person make a bona fide effort to abide by the Constitution and laws thereunder, and that an agent who does not make such a bona fide effort is not acting in performance of their duties. Because not all actions which are illegitimate have a remedy, merely trying to ensure that one's actions are unworthy of censure is insufficient to ensure legitimacy. A finding that a government agent deliberately seeks to skirt the law as much as possible should be taken as a finding that the person is not acting in good faith, and thus is not legitimately acting in the line of duty.