The arrest of a 16-year-old at Southmoor Academy in 2018 is ruled unlawful by a High Court judge.