The Australian Border Force has been ordered to release a suspected criminal from immigration detention on Christmas Island after a magistrate learned the agency secretly detained and transported the man to the offshore facility before the court could decide whether he should stand trial.