Tosfos (B.M. 10 acc. to one answer) writes that if someone appoints a shliach to do an aveira on his behalf, since ain shliach l'dvar aveira, the shlichus is nullified. The Noda b'Yehudah paskens on this basis that if a husband appoints a shliach to deliver a get and divorce his wife and the shliach violates the chareim d'Rabeinu Gershom by forcing the wife to accept the get against her will, the shlichus is nullified and the get is invalid.
The Ketzos (siman 182) disagrees. The Ketzos argues that the nullification of shlichus based on ain shliach l'dvar aveira applies only where the meshaleyach tells the shliach to perform an aveira on his behalf. However, if the meshaleyach appoints the shliach to act as his agent and the shliach of his own volition performs some aveira along the way, that does not cause the shlichus to be nullified.
The Ketzos proves his point by comparing the Noda b'Yehudah's scenario to a case discussed by the Mishne l'Melech (Hil. Geneiva ch 3). One of the exceptions to the rule of ain shliach l'dvar aveira is the case of slaughtering a stolen animal, e.g. if a thief asks a shochet to slaughter an animal he stole, the thief, not the shochet, is liable to pay the extra fine for tevicha/slaughtering the animal. What happens if the shochet slaughters the animal on Shabbos? Interestingly, so long as the meshaleyach did not explicitely tell the shochet to work on Shabbos, the meshaleyach (the thief) is chayav to pay the added penalty for the slaughtering of the animal and the shochet is chayav for breaking Shabbos. The fact that the shochet happened to do an aveira of chilul Shabbos while fulfilling the task the meshaleyach assigned to him does not constitute a shlichus l'dvar aveira and nullify his appointment.
So too, writes the Ketzos, the fact that the husband's agent happened to violate cheirem d'Rabeinu Gershom while fulfilling the task of delivering the get assigned to him does not constitute shlichus l'dvar aveira and nullify his appointment. So long as the husband did not order the shliach to act improperly, the shlichus is valid and the wrongdoing of the shliach is his own business.
What do you make of the Ketzos' proof? Can you draw a distinction between the case discussed by the Noda b'Yehudah and the scenario of the Mishne l'Melech?