It's not unprecedented to put a dead person on trial, but it is pretty rare that the deceased person actually appears in court. For a lot of boring political reasons, Stephen VII had it out for his predecessor's predecessor, Pope Formosus, so he accused him of even more boring papal crimes and actually interrogated the man's dead body before a court of bewildered clergy in 897. These days, you might get a handful of popes over your lifetime, but this was during a time when just about everybody in Rome got to be Pope for 15 minutes, so Pope Steve had to take drastic measures to appease the powerful in Rome, lest he be deposed or assassinated like so many before him in what was basically Game of Popes.
That doesn't mean he wasn't all too happy about the macabre spectacle: After parading Formosus's corpse, dressed in full papal vestments, into the courtroom and propping him up on the stand, Stephen "screamed and raved, hurling insults at and mocking the rotting corpse." He barked such questions as "When you were Bishop of Porto, why did you usurp the universal Roman See in such a spirit of ambition?" while a teenage deacon standing behind the former Pope served as the terrified Carroll Spinney to his Big Bird, but hopefully not before pausing comically and loudly declaring "Let the record show that the defendant has refused to answer the question."
Formosus was convicted by everyone who didn't want to piss off this clearly unwell and powerful guy, and that's where the real weirdness began. Stephen had Formosus's body stripped of the garments that he himself had ordered it dressed in and its three "blessing fingers" cut off before throwing it in a commoner's grave and then changing his mind and having it thrown in a river. It was later pulled out by a monk and rumored to have started performing miracles like some kind of helpful zombie, which may have contributed to the fondness for Formosus and anger toward Stephen that emerged in public opinion. Before long, Stephen was deposed, imprisoned, and strangled in jail, and over the next decade, Formosus's conviction was overturned and reaffirmed three separate times. The trial of corpses was also prohibited, "because come on, guys," Pope Sergius III is said to have reasoned.