Defendants cannot switcheroo whenever they want. There are good reasons why this is almost never done.
The lawyer in any of these scenarios is violating an ethical duty of candor to the tribunal, if it is done without court permission (which is unlikely to be granted), even if the client suggested or insisted upon the idea. The lawyer would be responsible for his or her client's actions by cooperating in it, rather than calling out his client in open court over the objections of the client to prevent the switcheroo from working, as the lawyer would have an ethical obligation to do. I would not really consider this to be a gray area. The relevant ethical rules and the related official commentaries to them are quite clear, even if they are not absolutely perfectly clear. Those rules create an affirmative duty of an attorney to prevent his or her client from misleading members of a tribunal (either a judge or a jury or both). Cooperating with this scheme could (and likely would) result in professional licensure related sanctions ranging from a private censure to disbarment for the lawyer, just as it did in the linked 1994 case.
Also, while a "not guilty" verdict was entered in the 1994 case, the prosecution would have a good chance of success if they demanded that the judge declare a mistrial, and also a good chance of avoiding double jeopardy limitations in this situation, because the mistrial arose from the actions of the defendant trying to bring about the situation. On the other hand, if this trick worked so well that the prosecutors came to the conclusion that their primary witness linking the defendant to the crime was wrong and that the defendant was not actually the person who committed the crime, the prosecutors would have an ethical duty to not attempt to prosecute the individual whom the prosecutors now believed to be factually innocent (the analysis is actually a bit more complex than that, but that is the gist of it).
The defendant and the attorney could (and likely would) also each be held in direct, punitive contempt of court by the judge for this conduct, allowing them to be summarily punished by imprisonment or a fine to an extent similar to a misdemeanor violation, on the spot, without a trial other than an opportunity to explain themselves to the judge in a sentence or two each, since it would be conduct in violation of the good order of the court and disrespectful of its rules and decorum conducted in the actual courtroom in the presence of the judge. Each could easily end up spending several months in jail on the spot for that stunt and perhaps a $1,000 fine each, if the judge was sufficiently displeased. There would be a right to appeal this contempt of court sanction, but the contempt of court punishment would almost surely be upheld on appeal in these circumstances.
In a case where the criminal defendant faces extremely severe sanctions if found guilty, such as the death penalty or life in prison, and the defense attorney was a self-sacrificing idealist or close family member of the criminal defendant, one could imagine the defense attorney and client deciding that the professional and contempt citation sanctions were worth being punished with, in order to save the life of the criminal defendant, if they also were convinced that this trick would work so well that the prosecutors would be persuaded of the criminal defendant's innocence sufficiently to not insist on retrying the criminal defendant in a new trial. This would be somewhat analogous to an intentional foul in basketball, but with much higher stakes. But, this would be an extraordinarily rare situation in court, because the punishment for this "intentional foul" in the courtroom are much more severe, and because the likelihood of it producing a beneficial result is much smaller.
It isn't hard to understand why a successful switcheroo feels morally justified. It prevents a witness whose testimony would have been much less reliable than it actually would have been from being used to convict a criminal defendant who might conceivably be factually innocent. And it might be very hard to discredit the testimony of that witness in any other way in order to prevent a wrongful conviction of the criminal defendant. Eye witness misidentifications are one of the leading causes of wrongful convictions, and are especially common in death penalty cases because jurors are "death qualified" making them more pro-prosecution than a typical jury. Preventing innocent people from being convicted of crimes is one of several important values of the criminal justice system, and this is the instinct that probably motivated the dissents in the professional misconduct process in the 1994 case. But, the court system also strongly values candor on the part of attorneys, and likewise values not having the court systems be used to trip up witnesses who may sincerely think that they are telling the truth even if they are mistaken about the accuracy of their testimony, in a deceptive manner. In this situation, the latter candor consideration usually prevails, because the rules prohibiting this kind of conduct and scheme, which admits no "moral justification" or "necessity exception", are quite clear.
In the same vein, a prosecuting attorney can be sanctioned (and has been on at least one occasion in Colorado) for not being truthful in communications to third parties, even when the lies are used to peacefully defuse a potentially deadly hostage situation. For attorneys, the duty of candor and truthfulness really knows no exceptions. Cops, in contrast, however, are allowed to lie in many circumstances to secure confessions or stop criminals.