Does the insanity defense ever work in one of the ways used in Law & Order?

Inspired by the thread on the movie / TV characters who might actually be villains. One of the ways that the insanity defense is frequently used on L&O seems to go like this. Bad Guy kills or rapes someone. They are suspected of the crime, but plead innocent based on not having done it. The court case is going poorly, and the DA tells the cops they need more evidence. More evidence is found, at which point the defense attorney, upon being presented with the new evidence, has in hand a motion to conduct the defense based on mental disease or defect, handing over the paper to the DA right away. Does this particular way of pleading insanity ever happen or work in real life?

I don’t mean insanity defenses in general. I mean the particular defense where someone pleads not guilty based on not having done it, but once that is no longer likely to work because more evidence comes to light, they change their plea to not guilty by reason of insanity.

IANAL - As I understand, the defense can introduce whatever theory and change their plea during a trial. Denying the defendant that opportunity would be limiting their ability to defend themselves.

Having said that - there are dangers. By claiming insanity, the defendant is admitting he did it. I suppose he’d better be damn sure there’s no way a reasonable doubt on that act would be believed. Worse yet, if it’s a jury trial, throwing multiple contradicting theories one after the other may convince the jury it’s fake.

Beyond that, I suppose we’d want to hear from someone who knows what the law is about “irresistible urges” or similar “mental defect” pleas and what categorizes behaviour as such. I presume that would have to be attested to by an expert witness. Plus presumably the defendant would be obliged to let a prosecution’s expert witness examine him, so then you get to the dueling experts scenario.

What I’ve read is that despite publicity in a number of high profile trials, insanity defense is pretty hard to prove especially when faked. Plus, it helps to have demonstrative evidence of the problem that pre-dates the offense, like letters to Jodie Foster that seem out of touch with reality. (And even when someone wins it’s possible to end up locked up for decades).

Irresistible impulse is no longer the basis for an insanity defense; if it did, it would be a convenient go-to for everybody addicted to drugs or alcohol.

Instead, an insanity defense must be based on arguments that the defendant could not distinguish right from wrong. So, attempts to hide the evidence or evade detection would undermine such a claim.

Usually, invoking an insanity defense opens up the defendant to psychological examination by the prosecution, and they will then be able to have their experts challenge whether the defendant is malingering or sincere. Your state’s mileage may vary on that point.

This could happen in real life.

The defendant (or his lawyer) can plead any way they want, they can change tactics halfway through if their mood swings differently. It still boils down to demonstrating to the jury (or judge) that they meet the requirements for their plea. At the end of the trial, in the summation, they can explain why the evidence presented demonstrates their case, and why the prosecution has failed to demonstrate theirs.

I imagine there may be a certain amount of readjustment by the prosecution if they have to prove something different “He was not insane when he did this”. They may need to change expert witnesses, pause for a psychological examination, etc, etc. I doubt the judge will tell them “no” if the defense is the one causing the problem. I assume the same would happen if a witness surprised the court with a revelation out of the blue…

Also I presume much of the evidence for a serious crime has been heard by a grand jury. The prosecution has grilled the key witnesses and knows the answers. A witness who changes their testimony will open themselves up to a perjury charge if they are not careful.

Also note the typical serious crime nowadays takes well over a year to come to trial. (OJ for example asked for a trial as quick as possible, and it took a year to get there. Casey Anthony did not get tried until 3 years after her child died.) Presumably, the prosecution has looked at all the evidence, especially in murder cases, and thought through the scenarios - “is there anything in this that could lead to an insanity plea? self defense?” They’ve likely checked the boxes on why they think that won’t work.

If Law & Order were like real life, the perp would be arrested in Season 1 and the trial would happen in Season 3. They’re not chasing down fresh leads the night before the trial.