A Question Re Legal Ethics

The Wall Street Journal’s Dorothy Rabinowitz has an op-ed today reminding readers of the inglorious role that Martha Coakley played in one of – certainly in my view – the greatest miscarriages of justice of the past twenty years in the United States, the persecution in Massachusetts of the Amirault family on prosecutor-contrived charges of child abuse.  (I use the indicative entirely here because I do not believe there is anyone serious left who does not by now believe this was a set of charges trumped up by prosecutors.)  (Update: Agreeing with commenter Denver below, I am pulling some of this language as unrelated to the legal ethics question but preserving it below in the comments.)

As it happens, those prosecutors – late in the game, as saner judges were starting to take hold of the process – included the then-Middlesex County prosecutor, Martha Coakley.  According to Rabinowitz’s account, before agreeing under great pressure from judges and the public to agree to reduce Cheryl Amirault’s sentence to time served, Coakley

asked the Amiraults’ attorney, James Sultan, to pledge—in exchange—that he would stop representing Gerald and undertake no further legal action on his behalf. She had evidently concluded that with Sultan gone—Sultan, whose mastery of the case was complete—any further effort by Gerald to win freedom would be doomed. Mr. Sultan, of course, refused.

Assume that this account is correct.  I am not an expert in legal ethics, not being any kind of litigator, and although I suppose this kind of question is obvious enough that lawyers generally ought to know the required ethical answer, I don’t.  Is it ethical under Massachusetts ethics rules for a prosecutor to ask, as a condition of doing something for one defendant (or the same, for that matter), to ask in exchange that the attorney representing a criminal defendant step aside?  It seems ethically weird to me that it would be permissible for a prosecutor to seek to affect a criminal defendant’s choice of attorney, more so in exchange for something, and even weirder in exchange for something in relation to another criminal defendant.  And, according to Rabinowitz’s account, apparently as a request/offer to the attorney involved (hard to tell if this was meant to be conveyed to the client or not).  Can someone knowledgeable explain to me what the situation is under standard legal ethics rules, assuming the facts as expressed above?  Assuming these facts, is this okay?