The Enforcement Rules of the Immigration Act Article 21

If the temporary detention order of a detainee becomes invalid in accordance with Paragraph 5 of Article 38-2 of the Act, and if the deportation order is still effective and one of the circumstances set forth in Paragraph 1 of Article 38 of the Act are met, the National Immigration Agency may, after considering judgements of the court for releasing the detainee, impose alternatives to detention in accordance with Paragraph 2 of Article 38 of the Act to ensure that deportation of the person can be enforced.
中文原文 入出國及移民法施行細則第21條
受收容人之暫予收容處分,依本法第三十八條之二第五項規定失其效力時,如其仍受強制驅逐出國處分,且有本法第三十八條第一項所定各款事由之一,移民署得審酌法院裁定釋放受收容人之理由後,依本法第三十八條第二項規定為收容替代處分,以保全強制驅逐出國之執行。

English translation for reference only; the Chinese text prevails. Not legal advice.