A legal challenge by the parents of a seriously ill five-year-old girl against the refusal of an NHS trust to allow her to fly to Italy for treatment is against her best interests and sets a dangerous precedent, a court has heard.

Tafida Raqeeb, from Newham in east London, is on life support at Royal London hospital after sustaining a brain injury in February. Doctors at the hospital have said she has no awareness and, with no prospect of recovery, life support should be withdrawn.

Barts NHS trust, which runs the hospital, has applied to the high court to withdraw treatment, but Tafida’s parents simultaneously took the unusual approach of bringing a judicial review against Barts’ decision not to permit her to travel to Gaslini children’s hospital in Genoa.

On Tuesday, Katie Gollop QC, representing the trust, warned allowing judicial reviews of such decisions could impede doctors when reaching decisions about end-of-life treatment.

“These sort of claims are not in the best interests of the child, the child’s welfare,” she told the court. “These sorts of claims make it impossible [for doctors] to negotiate [with parents] in a safe way, if you are going to be accused of detaining a child unlawfully. They will be damned if they do and damned if they don’t.”

Tafida’s parents, Shelina Begum, 39, and Mohammed Raqeeb, 45, want to transfer her to Italy because patients there are only removed from life support in the event of brain stem death, consistent with the parents’ religious beliefs as Muslims. Lawyers acting for them and Tafida have argued that forbidding the transfer infringes the family’s right to their religious beliefs and free movement under EU law.

But Gollop said: “The correct analysis is that where a range of different options for care and treatment of Tafida would all fall within her best interests, the religious wishes of her parents may be reflected.

“However, if the parents’ religious interests conflict with what care and treatment is in Tafida’s best interests, that conflict must be resolved in favour of Tafida’s best interests.”

Responding to the argument that the trust is in breach of EU free movement law, which confers a right to receive services anywhere in the bloc, Gollop said member states had discretion in areas of children’s rights.

“If it is right that more ventilation is not in the child’s best interests, it wouldn’t be in their best interests wherever the ventilation is provided,” she added. “If it is not in her best interests in London, it is not in her best interests in Cornwall, Leeds, America, Rome or Canada or anywhere else.”

The court has heard Tafida, who was born with blood vessels in her brain that were tangled up, could live for 10 to 20 years on ventilation. But Gollop said the five-year-old cannot see, feel, taste or move and in the future faces being doubly incontinent, sustaining spinal curvature and dislocation of the hips, and probably developing epilepsy.

Gollop said the trust had done its best to comply with the parents’ wishes. “However, it reached the point where the doctors’ medical assessment as to Tafida’s best interests no longer reflected the parents’ preferences,” she said.

In such circumstances, she said that had the trust agreed to the transfer to Italy, it would have been in breach of its statutory duty to safeguard and promote Tafida’s welfare, stressing that treating a child when not in their best interests amounted to assault.

The case continues.