An Illinois mother accused of strangling her 2-year-old son was suffering a "psychotic episode" when the child was killed, her high-profile defense attorney says, even as prosecutors allege she was plotting to poison her husband.

The competing accounts come as Corie A. Walsh's attorneys accuse jail officials of failing to provide her prescribed psychiatric medication after hospital doctors recommended she receive around-the-clock psychiatric care upon her discharge, according to the defense.

The sharply different portrayals of Walsh's mental state underscore a central legal question likely to shape the case: whether evidence of severe mental illness can satisfy Illinois' legal standard for insanity.

ILLINOIS MOTHER CHARGED WITH MURDER IN DEATH OF 2-YEAR-OLD SON IN CASE DRAWING COMPARISONS TO LINDSAY CLANCY

Andrea Lyon, a prominent defense lawyer who previously served on Casey Anthony's legal team, said in a statement to Fox News Digital this week that Walsh's actions were driven by mental illness.

"This is a tragedy for the Walsh family, all of whom are mourning the loss of this child," Lyon said. "It is also a tragedy in that Corie herself was experiencing a psychotic episode at the time this happened."

MOM ‘VERY INVESTED’ IN LINDSAY CLANCY CASE HIRES CASEY ANTHONY ATTORNEY AFTER ALLEGEDLY KILLING SON: DOCS

While Lyon described Walsh as experiencing a psychotic episode, legal experts say a psychiatric diagnosis alone does not determine whether someone meets Illinois' legal standard for insanity.

"The definition of insanity is, as a result of a mental defect or disability, that you're unable to appreciate the criminality of your conduct," Richard S. Kling, a clinical professor at Chicago-Kent College of Law and former Cook County public defender who has handled insanity cases, told Fox News Digital.

ACCUSED NC KILLER MOM PLANS INSANITY DEFENSE — AS RETIRED JUDGE SAYS MORE MAY FOLLOW LINDSAY CLANCY STRATEGY

Kling said psychiatrists first determine whether someone meets the criteria for a recognized mental illness before courts consider whether that illness prevented the person from appreciating the criminality of their conduct. He also said defendants who pursue an insanity defense must present evidence they were legally insane at the time of the alleged offense. Illinois also recognizes a separate verdict of guilty but mentally ill, distinct from a finding of not guilty by reason of insanity.

But behind the scenes, a battle over Walsh's mental health care is unfolding.

Following her arrest, Walsh was treated at Silver Cross Hospital for self-inflicted wounds to her wrists and thighs. According to her defense team, hospital doctors recommended she receive 24/7 psychiatric care upon her discharge.

However, Walsh's attorneys said she is not receiving her prescribed medication inside the Will County Adult Detention Facility.

The Will County Sheriff's Office, which oversees the jail, did not respond to Fox News Digital's request for comment regarding Walsh's medical treatment.

The defense's account differs sharply from prosecutors' allegations.

LINDSAY CLANCY DEFENSE SCORES ‘EXTREMELY HELPFUL’ PSYCHOSIS CONCESSION AS EXPERT FLAGS NEXT HURDLE

Along with three counts of first-degree murder, prosecutors also allege Walsh was planning to poison her husband Michael Walsh, before her son's death.

Further details regarding the alleged poisoning plot – including how far along the plan was or what substance was involved – were not immediately disclosed in court. Michael Walsh was traveling out of state when the couple's son was killed and flew home that evening. He has not responded to Fox News Digital's request for comment.

FOLLOW THE FOX TRUE CRIME TEAM ON X

Speaking generally and not about Corie Walsh's case specifically, Kling said evidence that a defendant planned or attempted to conceal a crime can become relevant in an insanity case because prosecutors may argue it shows the defendant understood the criminality of the conduct.

Walsh allegedly told police she killed the toddler because she believed he was the "devil," a petition seeking to deny her pretrial release states.

Witnesses also told investigators Walsh had recently grown "very invested" in the trial of Lindsay Clancy, a Massachusetts mother who was charged with murdering her three children during an alleged bout of postpartum psychosis.

SIGN UP TO GET THE LATEST TRUE CRIME NEWS

Walsh allegedly texted friends about the Clancy case as late as 12:30 p.m. on the day of her son's killing.

LIKE WHAT YOU'RE READING? CLICK HERE FOR MORE

"It is our hope that through a thorough presentation and investigation of the facts, that all of us will come to see this heartbreak for what it is," Lyon said.

SEND US A TIP

The competing claims have prompted a deeper investigative look into Walsh's background.

GOT A TIP?

Kling said a documented history of mental illness, psychiatric treatment and medication can become critical evidence in an insanity case because psychiatrists often examine a person's mental state before and after an alleged crime to help evaluate their condition at the time of the offense.

LISTEN TO THE NEW 'CRIME & JUSTICE WITH DONNA ROTUNNO' PODCAST

Fox News Digital has reached out to multiple immediate family members, in-laws and former neighbors to determine whether there were prior warning signs, isolation or documented mental health struggles leading up to the holiday weekend.

GET BREAKING NEWS BY EMAIL

Additionally, Fox News Digital has filed public records requests with local police departments seeking years of 911 dispatch logs and wellness checks connected to Walsh's current and former residences.

Because of the victim's age, the three first-degree murder counts carry a potential sentencing range of 60 to 100 years in prison, to be served at 100% upon conviction.