Is this a common defense to use on an accuser? Is it taught in law
school to use this defense?
First of all, it isn't a "defense", it is an argument about the credibility of a witness. The defense is that the prosecutor or plaintiff has failed to prove his or her case (or a defendant has failed to prove an affirmative defense) because the sworn testimony from the witness that supports that claim or defense isn't credible and shouldn't be believed.
It is routine to cast doubt on a witness's credibility.
It is quite unusual to accuse someone of being a "fantasist", although despite your lack of experience with such people they most definitely do exist.
I have seen witnesses who just make things up out of whole cloth many times, sometimes for no good reason.
For example, I once questioned a witness in a video deposition in an intellectual property lawsuit who absolutely insisted that two bottles, previously measured to be exactly the same height, were obviously of greatly different heights, despite the fact that doing so did nothing other than to undermine his own credibility.
I've also seen accusations made in cases that simply have no connection to reality whatsoever, like accusations that someone wrote dozens of checks that were never written, or that someone was at a particular place when they were actually hundreds of miles away at that time, or that long elaborate conversations that never happened took place.
Law schools teach various approaches to disproving credibility, but calling someone a "fantasist" is not one of them and if a prosecutor calls something a "liar" in closing argument, that can be grounds for a mistrial in a criminal case (the actual rule is a bit more subtle than that as explained in the linked materials). One reason to call someone mentally ill rather than a liar (probably incorrectly) is to attempt to avoid triggering a mistrial for this reason.
I mean unless someone is completely insane they surely have a reason
for lying. Even a fantasist can surely separate real life from their
Someone who lies not in the own self-interest, but for no reason, just because they can't separate real life from their fantasies is called a "confabulator" in the psychiatric literature.
Some of the more common causes of that kind of behavior are a thiamine deficiency, dementia associated with old age such as Alzheimer's disease, schizophrenia, traumatic brain injury, and mass hysteria (e.g. in the Salem Witch trials and more recent Satanic Ritual Abuse cases). Sometimes this behavior isn't totally random, and is instead tinged with paranoia.
Some people, with a condition known as "psychopathy" recklessly lie in their own self-interest without feeling any guilty or discomfort. When somebody lies to cause you to doubt your own grasp of reality, it is called "gaslighting" which is a particularly common tactic of psychopaths.
Another psychological process which isn't that uncommon in overall sane people, and produces similar results, is for someone who has experienced a confusing event to try to craft a narrative of that event that makes sense, influenced by their own biases and suggestions that they receive from others, until they rehash it enough in their minds to come to believe that it is true. It is a bit like playing the game of telephone with yourself.
It is not uncommon, however, for the general population to display
some very mild symptoms of provoked confabulations. Subtle distortions
and intrusions in memory are commonly produced by normal subjects when
they remember something poorly.
And if they were really insane wouldn't they be in a mental
In the United States, as a consequence of a policy called "deinstitutionalization" there is very little long term inpatient mental health care and the number of long term psychiatric beds continues to decline every year. There are far more mentally ill people in prisons and jails than there are in mental institutions.