Home Affairs officials were mulling laws to lock up high-risk immigration detainees as a “contingency” several weeks before the Commonwealth lost the High Court case that led to the release of 149 people that included convicted murders, rapists and kidnappers.