Kristin Chenoweth reacts to the news that NBC didn’t renew “Trial & Error.” (NBC)

It is the (fictional) trial of the century.

The accused murderer is Lavinia Peck-Foster (Kristin Chenoweth), the beloved heiress who’s paid for nearly everything in the town of East Peck, S.C., including the police uniforms (but also seems to be flat broke).

A cop pulled her over to issue a warning for going 95 mph in a 30 mph zone, accidentally opened her car trunk and found the body of her husband stuffed in a suitcase. “Put it in the warning,” she says. But he arrests her on account of murder being illegal.

The case unfolds on Season 2 of NBC’s “Trial & Error,” a delightfully wackadoodle spoof of TV’s obsession with crime documentaries. The series airs at 9 p.m. on Thursdays.

To defend herself, Peck-Foster hires eager and earnest lawyer Josh Segal (Nicholas D’Agosto). His rather bizarre staff includes the moonlighting cop Dwayne Reed (Steven Boyer), who shot off his pinky toe during a school demo of how to handle a Glock 17, and sweet-natured researcher Anne Flatch (Sherri Shepherd), who sometimes spontaneously combusts.

Presiding over the trial is Judge Alexander Kamiltow (yeah, just say it out loud). Played by Joel McCrary, he speaks in an inaudible Donald Duck voice that you and I and attorney Segal (who is not a native Pecker) cannot understand but that the townsfolk have no problem with.

Because this is a show that believes in maximum joke possibilities, a podcast called “M-Towne” is covering the trial (the “M” is for murder). An homage to the 2017 hit podcast “S-Town,” M-Towne refers to East Peck as “the Fallujah of the South.”

The best thing about this season is the transcendently nutty performance by Chenoweth. She enters the courtroom and trills, “I bought everyone scarves,” sings “A Bird in a Gilded Cage” while holding the antlers of a taxidermied moose, and pronounces the name of a packet of vending machine cookies “Lorna Do-Onus.”

Meanwhile, there is a tragedy to ponder more tragic than the death of Lavinia’s husband: NBC has passed on renewing the series. We fans must utter a gilded prayer that another platform will step in so “Trial & Error” does not become a dead body stuffed in a suitcase.