A former New South Wales detective Gary Jubelin has been found guilty of unlawful conduct while he led the long-time investigation into William Tyrrell’s disappearance.

The former detective chief inspector contested allegations he unlawfully recorded four conversations with the Tyrrell family’s elderly neighbour Paul Savage in 2017 and 2018.

However, Sydney magistrate Ross Hudson on Monday found Jubelin’s conduct was unlawful.

While Savage was the subject of surveillance warrants at the time, the devices used by Jubelin to record the conversations were not authorised.

Jubelin – who quit the force in 2019 – defended the recordings, saying they were made to protect himself in the event Savage made a complaint or self-harmed and his colleagues did not defend him.

Prosecutor Philip Hogan argued that a decision to acquit Jubelin would have rendered useless comprehensive frameworks around privacy and police surveillance.

He argued no police officer was above the law and his defence was baseless.

William vanished in September 2014 while playing at his foster grandmother’s home in Kendall on the NSW mid-north coast.

No one has been charged over his disappearance. Savage denies any involvement.

During the 10-day hearing earlier this year in Downing Street local court, Jubelin aired claims that then-homicide commander Superintendent Scott Cook in 2017 said “no one cares” about the missing toddler.

Cook denied the accusation and NSW police commissioner Mick Fuller issued a statement supporting him, describing him as “exemplifying the definition of a leader”.

William’s foster mother said Cook made similar remarks to her in 2019.