The Goldwater rule isn't that you have made an in-person evaluation of the person. Merely, that you have conducted an examination (many of my examinations are based on record review alone) and have consent to do so. The code states: "However, it is unethical for a psychiatrist to offer a professional opinion unless he or she has conducted an examination and has been granted proper authorization for such a statement." This is the key issue. While public figures have fewer rights to privacy than other individuals, the APA's position is that like any other medical procedure, it is unethical to perform a psychiatric diagnostic evaluation and disclose the results of that examination to the public without the person's consent. Personally, I don't agree with this and no other specialty prohibits their physicians from diagnosing public figures (one of the professional societies I am a member of actually released a statement diagnosing people by video in the public interest). Indeed, no other mental health professional society prohibits its members from diagnosing public figures. The idea that it is unethical is ludicrous. The more compelling reason to advise against diagnoses and formulations of public figures is it can prove embarrassing for the profession. The number of psychiatrists that incorrectly diagnosed Trump with NPD (any forensic psychiatrist worth their salt would know the correct diagnosis) was cringeworthy, for example. If you read the original Fact magazine article about Goldwater, the psychiatrists commenting make psychiatry seem like a joke. What is more of a joke, is that some psychiatrists believe the public is interested in what they have to say. They don't, unless it suits their own agenda.
Most psychiatrists who would fall foul of this rule are not APA members and actually I know of several who resigned their APA membership in order to avoid censure by the Ethics committee (though I don't believe the ethics committee actually censures anyone). Bandy Lee is not an APA member and thus is not required to adhere to the Goldwater rule. Psychiatric formulations of political leaders have been used by the CIA and Presidents since the 1970s to great effect as well.
Bandy Lee was not "terminated" from Yale in any true sense, as she was not an employee. She had a voluntary (i.e. unpaid) assistant clinical professor appointment and thus did not enjoy the same academic freedoms and due process rights that a true faculty member would. Though that is not stopping her from suing them arguing violation of her rights to free speech, breach of contract, and negligent misrepresentation by not allowing her academic freedom. She is arguing that all the perks she got would cost thousands, and she made a lot of money off her affiliation with Yale (she says most of her income), even though Yale paid her nothing itself. It will be interesting to see if the lawsuit goes anywhere. I bet they weren't expecting her to sue them. They were probably more worried they would be sued by Dershowitz if they didn't cut ties with Lee.