Although trial judges may question witnesses "to clarify and develop testimony," Elliott wrote that Trent's questions had "the effect of negating [Shwarz's] defense and may have given the jury the impression that the judge doubted [Shwarz's] credibility and the credibility of other witnesses."
Shwarz, 58, an officer for 21 years, has already served his 1- to 2-year prison term and is on eight years' probation.
Shwarz declined comment Wednesday: "I don't wish to say anything until I hear what the District Attorney's Office will do."
The District Attorney's Office, which could retry Shwarz or appeal to the Supreme Court, had no immediate comment.
Trent could not be reached for comment, although judges are barred from commenting on cases before them.
Shwarz was found guilty in April 2012 of obstruction of administration of law, unsworn false statements, filing false reports, false imprisonment, and official oppression.
The case involved a March 4, 2010, argument at a U-Haul rental facility in the Northeast.
According to court testimony, Shwarz and his partner were called to the business by manager Dominic Catalano, who asked them to remove one of his trucks from a police stolen-vehicles database because it had been found at Philadelphia International Airport and returned.
When Shwarz told Catalano he had to talk to Delaware County authorities because of where the truck was found, Catalano complained that he thought the officers did not want to be bothered.
An argument ensued, and Catalano followed the officers into the parking lot to get their names and patrol car number. Instead, Shwarz pushed Catalano against a wall, took him to the ground, and handcuffed him.
Shwarz said Catalano swore at him and "shouldered" him as he walked to the rear of the patrol car. Catalano said he never touched either officer, and a surveillance video corroborated his assertion.
A day after Catalano's arrest for assaulting an officer, he was released when the District Attorney's Office declined to prosecute. Ten months later, prosecutors charged Shwarz.
"The sad thing is," said defense lawyer Gerald S. Stanshine, Shwarz "already served his sentence, because the judge denied bail pending appeal."