Facts

The appellant [B.] (born 1975) is a Tanzanian national and entered Switzerland on 20 January 2003. Due to a first marriage to a Swiss national he was granted a residence permit. After divorce, he remarried a Swiss national on 4 August 2008; the couple's daughter was born on 3 October 2008. By judgment of 15 July 2011, the Horgen District Court authorised the spouses to dissolve the joint household; the daughter was placed in the custody of the mother and the father was granted a right of visitation.

By decision of 14 February 2012, the Zurich Migration Office revoked the residence permit and ordered the appellant's removal from Switzerland. The Federal Supreme Court confirmed this (judgment 2C_1047/2013 of 24 June 2014). The appellant did not depart within the departure deadline, which expired on 23 September 2014.

By decision of 12 July 2016, the Migration Office ordered confinement to the municipal territory of Urdorf for a period of two years, based on Art. 74 para. 1 lit. b FNA. The Coercive Measures Court of the Zurich District Court confirmed it on 14 September 2016, and the Zurich Administrative Court, 1st Division, single judge, by judgment of 10 April 2017 (VB.2016.00627). The Administrative Court additionally based the measure on Art. 74 para. 1 lit. a FNA, as the appellant had committed several offences between 2007 and 2012 (criminal damage, narcotics offences, threats, coercion, trespass, obstruction of an official act), further assaults occurred in 2013 and 2014, and on 26 January 2015 he had hidden marijuana in his footwear.

On 22 May 2017 the appellant lodged a public law appeal with the Federal Supreme Court, primarily requesting remittal for supplementary establishment of the facts, alternatively a finding of a violation of personal liberty; he also requested legal aid. The Migration Office did not file a response but submitted an amended decision of 31 August 2017, by which the area was extended to Lindau and Urdorf. The Administrative Court and the SEM requested dismissal; the appellant filed a reply.

Considerations

The appeal against the final cantonal decision on confinement is admissible (Art. 82 lit. a, Art. 86 para. 1 lit. d, Art. 90, Art. 89 para. 1 FSCA). The primary request for remittal is inadmissible, as the Federal Supreme Court may decide reformatively (Art. 107 para. 2 FSCA). In accordance with the principle of good faith, the request must be interpreted as a request to set aside the confinement.

Confinement under Art. 74 para. 1 FNA serves either to guarantee public security (lit. a) or as a coercive measure to secure and enforce exclusion measures (lit. b). Proportionality requires suitability, necessity and an appropriate relationship between purpose and means. Under lit. b, the measure can only achieve its aim if departure is actually possible; the examination is two-stage, first determining the aim, then examining whether the measure is suitable for that purpose.

The legal basis (lit. a, b or c) does not concern the subject matter of the dispute but the legal reasoning. The law must be applied ex officio, which is why substituted reasoning is permissible, including by the Federal Supreme Court (BGE 142 II 293 E. 1.3). The right to be heard, however, requires that the affected party be able to comment on a new legal basis not relied upon in the prior proceedings, which it did not have to anticipate (BGE 130 III 35 E. 5). The Administrative Court violated this right by basing the measure on lit. a without giving the appellant an opportunity to comment on the offences. The violation of the right to be heard is, however, not material, as the appellant was able to comment comprehensively on the ground under lit. b and on proportionality, and the confinement under lit. b must be confirmed (Art. 97 para. 1 in fine FSCA).

The statutory requirements of Art. 74 para. 1 lit. b FNA are met: the appellant is a Tanzanian national, an enforceable removal decision exists, the departure deadline has expired, and he refuses the written consent required for return. The measure is proportionate: the impossibility of forcible deportation to Tanzania does not render the confinement…