In the film The Matrix (spoiler alert for a film that came out closer to the foundation of Apple than today) it is revealed that the world as Neo knows it is not real, but is being simulated by intelligent machines far into the distant future.
In terms of movies that you would think could crop up in courtrooms, it's probably just as low on your list as the 2001 classic Freddy Got Fingered. However, the film has come up so much in trials that it has become known as "The Matrix Defense".
Following the success of the film, several defendants used The Matrix as part of their plea of diminished responsibility – sometimes successfully. Much like the Truman Show delusion (where people believe they are being secretly recorded for a TV show, sometimes after having seen the film The Truman Show), people have developed the delusion that reality is being simulated following viewings of The Matrix.
In 2003, several defendants used "The Matrix Defense" in court, including Washington D.C. sniper Lee Boyd Malvo. His lawyers argued that his sense of reality had been distorted by the movie, and even attempted to play a 12-minute clip of the first film (which was rejected by the court). Another teenager, Josh Cooke, was to use the defense after he shot and killed his parents while dressed similarly to Neo, though he eventually plead guilty before this defense could be tested.
The defense has been fairly unsuccessful and is, of course, more to do with proving that clients either have diminished responsibility by reason of insanity or that they are unfit to stand trial. However, in several cases, it has achieved what it was set out to do.
In 2002, 36-year-old bartender Tonda Lynn Ansley shot her landlady three times with a handgun. In a statement she sent to the court, she explained that her landlady and several other intended victims "commit a lot of crimes in `the Matrix' [...] That's where you go to sleep at night and they drug you and take you somewhere else."
The judge approved her insanity plea. In another attack on a landlady, 27-year-old Vadim Mieseges killed and dismembered his victim, claiming that he had done so out of fear of being "sucked into the Matrix". He was declared mentally incompetent to stand trial.