If a person is ineligible to be deprived of liberty by this Act, the court may not include in a welfare order provision which authorises the person to be deprived of his liberty.
If—
the provision ceases to have effect for as long as the person remains ineligible.
Nothing in subsection (2) affects the power of the court under section 16(7) to vary or discharge the welfare order.
For the purposes of this section—