A former staffer to a Federal Circuit Court judge has broken down in tears after he avoided jail time for perverting the course of justice by lying to his former boss to secure a character reference for a charge of cocaine possession.

James Cowled, a one-time law student who worked as an associate to Judge Michael Lloyd-Jones, told his former boss he had been charged with low-range drink driving after drinking two glasses of red wine over a weekend lunch in Sydney in March 2016.

James Cowled (right) with Federal Circuit Court Judge Michael Lloyd-Jones. Credit:James Cowled/Instagram

The former judge, who retired from the bench in 2015, agreed to provide a character reference in those circumstances – but media reports subsequently revealed Cowled had in fact been charged with cocaine possession.

Cowled, who has not completed his legal studies and does not intend to practise as a lawyer, was charged in early 2017 with perverting the course of justice after Mr Lloyd-Jones lodged a complaint at Waverley police station.