A loophole is leaving the most vulnerable pupils in England at risk