It's far worse than that. The basic approach of a "mental defect" defense in a criminal court is for the defense attorney to make the case that a defendant is not mentally competent to be responsible for the crime in question. Six months later, the same attorney will try to make the case that the same defendant is perfectly healthy and should no longer be confined.
Agreed. Fleeting mental defects are rare. Though there needs to be a mechanism for reversing mental incompetence adjudications in the even that the person’s condition actually changes (which medical advances may well make more common in the foreseeable future), the period of time during which someone is legally classified as mentally incompetent should be formally fixed. There is no legal basis for the current cafeteria-style approach, in which someone gets off the hook for a crime committed based on a claim of mental incompetence, but is not released from any and all contracts entered into during the alleged period of mental incompetence, even though contracts involving a mental incompetent as a party are void under common and statutory law. The periods of time involved in these specious defense claims are often much more fleeting than 6 months, and sometimes even virtually momentary (as in for the few minutes it took to plan and carry out the crime).