The High Court has ruled that forcing former immigration detainees to wear ankle bracelets and live under curfews is unlawful, in a massive blow to the Albanese government.