Some of the state's most senior Juvenile Justice managers signed off on the unlawful solitary confinement of a teenage boy in NSW youth custody centres, a lawsuit claims.

The case follows a scandal in which sixty-six young people, many of them Indigenous, were forced to spend up to 22 hours a day in dark cells as part of a behavioural program abandoned in 2016.

An inmate at the Cobham facility in Sydney's west, where Leaum Doolan claims he was isolated excessively. Credit:Kate Geraghty

It also sets the scene for a clash over whether detainees have “residual liberty” while in custody, as the NSW Crown Solicitor argues the term is “not known to the law”, despite Supreme Court justices applying it in recent years.

The plaintiff, Leaum Doolan, now 19, has been in and out of Juvenile Justice centres since he was 13. His lawyers, Maurice Blackburn, argue managers isolated him excessively as a punishment rather than for safety reasons, a breach of the Children (Detention Centres) Act.