(1) This section applies in relation to the following Orders—
(a) an Assessment Order;
(b) a Court Assessment Order;
(c) a Temporary Treatment Order;
(d) a Treatment Order.
(2) Subject to subsection (3), an Order to which this section applies has no effect while a person who is subject to the Order is detained in custody.
(3) An Order to which this section applies expires at the time it would otherwise have expired under this Act despite any period during which it has no effect by virtue of subsection (2).
(4) For the purposes of this section, a person is detained in custody if the person is held in—
(a) a prison; or
(b) a remand centre, youth justice centre or youth residential centre within the meaning of the Children, Youth and Families Act 2005 ; or
(c) a police gaol within the meaning of the Corrections Act 1986 ; or
(d) immigration detention within the meaning of section 5 of the Migration Act 1958 of the Commonwealth, unless the person is assessed or receives treatment as an inpatient.