Ever wondered what you would need to do to permanently silence or, if necessary, expunge any transgender members of your community? From a family court ruling published earlier this week came one possible answer. Ostracise their children.

Mr Justice Peter Jackson presided over what he called “a very troubling case” between a father and mother, “J” and “B”.

The mother opposed her estranged husband – who is now a transgender woman – having any direct access to their five children in the “fundamentalist community” (the judge's words) of ultra-Orthodox Jewish, or Charedi, Manchester.

The father said last year that she was almost certainly the first transgender person to have left one of Britain's Charedi communities – which practise a strain of Judaism largely unchanged since the 19th century – and added: "So they have to get rid of me".

And so it has come to pass. For Mr Justice Jackson ruled on Monday, “with real regret”, that the “loving father” will be banned from "direct contact" with her children. She will be able only to write letters four times a year.

He said he had “reached the unwelcome conclusion that the likelihood of the children and their mother being marginalised or excluded by the ultra‐Orthodox community is so real, and the consequences so great, that this one factor, despite its many disadvantages, must prevail over the many advantages of contact”.

The judge admitted that his decision would be a "bleak conclusion" for "others facing these issues in fundamentalist communities".

Of course, the other side of that coin, however, is that it should come as heartening news for the leaders of insular communities looking to expel transgender or other "transgressive" people – or better still, to deter them from “coming out” in the first place.

The outcome almost offers a three-step plan for such communities wishing to cast out those who fail to toe the line:

Step 1: Religious schools would need to deliberately fail to encourage respect for citizens with protected characteristics (despite in the process contravening the Government's Education Regulations 2014, which focus on "promoting fundamental British values" and apply to both the private and state sector).

Step 2: This should be taken to the point where youngsters have no knowledge that such people even exist and where – as one of the children's head teachers told the court – “just hearing about it would be terribly confusing and unsettling”. The mere risk that a child could refer to his or her domestic situation in front of peers would mean the family would need to be subjected to "social isolation" (the phrase used by a rabbi giving evidence in the case) on a mass scale by parents, teachers and beyond.

Step 3: The community, schools and other bodies should then deploy witnesses in a British court of law to flaunt what the judge described as "clear examples of discrimination and victimisation" – but which are then cited by the judge himself as a "central" reason why the father must not be allowed access to her children.

A school that discriminates against a child because his or her parent is LGBT will have broken the law (specifically, the Equality Act 2010). As the judgment says: “Schools with a religious character benefit from certain exceptions, but these do not permit them to discriminate on the basis of protected characteristics.”

In testimony brought forward by the wife in this case, another mother who is a member of the city's Charedi community (Mrs S2) told of how after her ex-husband “left the folds of observant Judaism”: “My youngest child was not accepted into the school that my other children had attended, as the school would not risk the influences their father’s contact with the child might have on the rest of the student body.”

Nevertheless, Mrs S2 explained: "This is the unfortunate price a child within an ultra-Orthodox community pays for the actions of their parent."

In other words, the child – despite living in Manchester of 2017 – is, quite literally, punished for the “sins” of the father.

The head teacher of one the children in this case gave a statement saying: “If a child was already in the school, the school would face tremendous pressure from the parent body, private donors and the governors, to suggest that the child find a more suitable educational environment.”

A teacher at another school attended by one of the five children added: “The school will experience tremendous pressure... not to allocate a place to any child who will bring these potential risks. It would therefore be very difficult for the school to process an application for a child who fits the above description.”

The court was even told of a case of a 15-year-old girl who was forced to move schools after being ostracised by parents and pupils because she had been “sexually abused in the community”.

These admissions by teachers from several schools were so serious that the judge has sent a copy of his report to the schools minister, Nick Gibb.

"There is, to say the least, evidence that the practices within the community, and in particular its schools, amount to unlawful discrimination,” Mr Justice Jackson said.

If changes in the behaviour – and regulation – of the schools are required, he added: “Responsibility must fall on the shoulders of the schools, the community and the state, and not on the heads of young children.”

The fact that the schools were prepared to confess to apparent breaches of the law shows how keen they were for the mother to win this case.

But it is also possible that the claims of ostracism were overblown.

Robert Bernard, of GesherEU, a charity that supports those who have left Charedi communities, told the court that his organisation had not seen any evidence of children being ostracised. Instead, he spoke of “fearcasting”, or “putting into professional minds a fear that something bad will happen to the children if the community is contradicted”.

Apparent coercive techniques are not confined to Manchester. Last year, London's Stamford Hill community launched a £1 million fundraising drive to finance the legal fees of parents involved in a custody battle with an ex-partner who has attempted to join the “evil culture” of mainstream society. The highly public event was described by GesherEU as being as much a deterrent and “scare tactic” as a fundraiser, the message being: “If you leave, we have all the money, power and resources to fight you and ensure your children stay.”

A spokesman for Keshet UK, which works to eliminate discrimination against LGBT people within the Jewish community, said: “We are deeply upset by this cruel judgment. We are saddened that part of our community fought hard to keep five children away from one of their parents.”

Dayan Yitzchok Berger, a judge at the Manchester Beth Din – a key religious governing body in the Charedi community – told the New Statesman that nobody in his organisation had followed the case or read the judgment.

On the issue of children potentially being denied access to schools, he said: “If these schools are private schools, no-one can dictate to them, it's a private arrangement.” On the point that private schools are also subject to equalities legislation, Dayan Berger replied: “Then it's up to the Government to take it up, if that's the case.”

A spokesperson for the Department for Education declined to comment.