A NSW magistrate has been severely reprimanded for incorrectly applying the law, acting against the public interest, and undermining the administration of justice, according to a strongly worded Supreme Court ruling.

Key points: NSW Local Court Magistrate Roger Prowse accused of "clear error"

NSW Local Court Magistrate Roger Prowse accused of "clear error" Magistrate refused to step aside from hearing a case, then ordered it be thrown out of court

Magistrate refused to step aside from hearing a case, then ordered it be thrown out of court Supreme Court Justice ruled he sought to "punish" police who "irritated" him

The local court magistrate Roger Prowse "diminished the court over which he presided" in wrongly accusing police of contempt of court, and then attempting to permanently halt proceedings against a man accused of the serious assault of a child protection worker, NSW Supreme Court justice Helen Wilson said.

The ruling followed a successful judicial review by the NSW Director of Public Prosecutions of Magistrate Prowse's orders in a criminal case against a man accused of assault occasioning actual bodily harm and threatening a witness.

The man, who cannot be named for legal reasons, had been due to appear in Liverpool Local Court on the assault charge in late December 2014 after allegedly grabbing a child protection worker by the throat and throwing her to the ground during a supervised access visit with his son.

On the morning the man's matter was due to be heard, police allegedly saw the man scribble a threatening message on the court list which was allegedly directed at the child protection worker.

Police arrested the man in the foyer of the court and charged him with influencing a witness. The court matter was delayed.

Magistrate's irritation with police 'wholly misplaced'

In her ruling, Justice Wilson said Magistrate Prowse had became annoyed that the man was not in a position to appear before his court because of his arrest.

"The Magistrate's response was to insist that the first defendant be 'unarrested' despite the fact the prosecutor had no power to do so," Justice Wilson said.

The Magistrate had wrongly believed police had committed a contempt of court by arresting the accused man in the court's foyer. The prosecutor was accused of "immaterial interference with a court hearing" by the magistrate.

Got a confidential news tip? Email ABC Investigations at investigations@abc.net.au For more sensitive information: Text message using the Signal phone app +61 436 369 072 No system is 100 per cent secure, but the Signal app uses end-to-end encryption and can protect your identity. Please read the terms and conditions.

When the prosecutor requested the magistrate step aside from hearing the case, Magistrate Prowse refused to do so, initially without hearing any argument.

Justice Wilson said Magistrate Prowse had exhibited "irritation with the police" which was "wholly misplaced".

"His intent seems to have been to punish the prosecution for what he regarded as contemptuous interference in the court's processes by the police who had arrested the first defendant," Justice Wilson said.

"The public interest includes the determination of criminal charges by the courts and the conviction of those found guilty of crime, to guarantee peace and order in society, as well as the maintenance of public confidence in the criminal justice system.

"The latter is not served by a judicial officer acting in a peremptory and injudicious manner, including to punish a party which had irritated him, as I am satisfied occurred here.

"Such an approach to the exceptional power of granting a permanent stay of a criminal prosecution bespeaks clear and fundamental error."

Justice Wilson said Magistrate Prowse's actions had "occasioned a serious injustice", that the magistrate "fell into error" and "undermined the proper administration of justice and diminished the court over which he presided."

She quashed Magistrate Prowse's orders and ruled the case be sent back to Liverpool Local Court and heard by a different magistrate.