The Home Office guidance (published on 20 October 2014) contained the wrong test.
It is unlawful, imposes a higher test than that contained in the statute  and should not be followed, according to Mr Justice Walker in R (X) v Secretary of State for the Home Department  EWHC 1997 (Admin) (see §§ 17(3), 131 – 132).
It was a matter of time before this conclusion was reached. (The guidance has been through several revisions since it was first published and now it appears to have addressed this problem).
X follows a successful challenge in R (Kiarie) and another v Secretary of State for the Home Department  EWCA Civ 1020 to the similarly worded provisions and guidance on section 94B NIAA 2002, and the comments of the Upper Tribunal in R (Masalskas) v Secretary of State for the Home Department (Regulations 24AA and 29AA EEA Regs) (IJR)  UKUT 677 at §§ 19 and 29 to 31).
The judgment in X states:
17. … X is right to say that the guidance on regulation 24AA issued by the Home Secretary involved an unlawful policy. The reason is that it substituted a threshold test of “real risk of serious irreversible harm” for the true threshold test of whether removal would be unlawful under section 6 of the Human Rights Act 1988.
131. … The true position is that, applying the reasoning in Kiarie, a conclusion that there is no real risk of serious irreversible harm is no more than something which may be included in grounds for saying that the certification test is met.
132. The conclusion that this aspect of the regulation 24AA guidance was unlawful is
inevitable. The Home Secretary did not seek to contend otherwise.
X was also detained unlawfully for a period of 4 months. Initially, the Secretary of State used police rather immigration detention powers. Afterwards, she had failed to provide any justifiable reasons for detaining X. There was no real risk of X absconding on the basis that the Secretary of State believed that he lacked close ties (ie. family and friends) in the UK. While the Secretary of State put the onus on X to provide information about his community ties, there was no evidence that X had ever been asked for this information (see §§ 181 to 182).
The Court rejected a further challenge to regulation 24AA on the basis of incompatibility with EU law.
Leonie Hirst appeared for X, instructed by Deighton Pierce Glynn Solicitors.
 Regulation 24AA of the Immigration (EEA) Regulations 2006/1003 (‘the 2006 Regulations’).