Council lawyers have halted a bid to jail a man alleged to have breached orders relating to his children after a family court judge complained of incompetence.
Judge Gareth Jones said lawyers representing social services bosses had made at least six procedural errors when stating the case against the man.
He said the council had been "incompetent ... in this case" and described its performance as "poor".
The judge, who analysed the case at a hearing in the Family Division of the High Court on Wednesday, gave the council permission to withdraw its application to commit the man to jail.
Lawyers said they might make a fresh application.
They indicated that the man's children were abroad and that the man had breached a judge's orders by failing to get them back to the UK.
Judge Jones said the case had also wrongly been marked on court lists.
Listings contained only a case number and wrongly said the hearing was in private.
The judge said rules meant to ensure that journalists, and members of the public, were aware of applications to commit people to prison had not been followed.
Judge Jones said he did not want the name of the man, or the council, to be published in media reports of Wednesday's hearing.
He said the case was sensitive and "extremely serious" and said the identifies of the children might emerge if the man and the council were named.
Judicial heads have twice in recent years laid down rules relating to procedures judges must follow when considering applications to commit people to jail for contempt, in a bid to ensure that no-one is jailed in secret.
In March 2015 Lord Thomas, the then lord chief justice and most senior judge in England and Wales, said "open justice" was a "fundamental principle".
He said the general rule was that committal hearings were staged in public, orders were made in public and judgments were given in public.
Lord Thomas said a case listing should begin with the words: "for hearing in open court"; should contain the "full name" of the person or body applying for someone to be committed to prison; and should contain the "full name" of the person alleged to be in contempt.
He said if a judge was considering imposing any "derogation from the principle of open justice" media organisations had to be warned, so editors had a chance to raise objections.
Copyright (c) Press Association Ltd. 2018, All Rights Reserved. Picture (c) Kate Collins / PA Wire.