Long before the partner of the Guardian journalist Glenn Greenwald was detained at Heathrow airport on Sunday, the law that was used to hold him and remove his possessions had been effectively discredited in its present form. Schedule 7 of the Terrorism Act 2000 is a sweeping power to detain for up to nine hours. It gives border police a power of detention for questioning without specific suspicion or a right to be represented. It is one of the strongest police powers on the statute book – a useful weapon for security services trawling for information but a potential source of injustice waiting to happen. It has provoked some of the strongest community complaints about the way UK terrorism laws operate in practice. Parliament is already scheduled to reform it.

David Miranda's detention should be seen in the context of the implicit acceptance by the Home Office, which is bringing forward the current changes, that parts of the law are too sweeping. But Mr Miranda's detention is extraordinary nevertheless. It raises important new issues that parliament cannot now ignore and will have to debate if its terrorism law reform bill is to be in any way meaningful, just or proportionate.

Part of this is because there is not the slightest suggestion that Mr Miranda is a terrorist. But Mr Miranda does live with and work with Mr Greenwald, who has broken most of the stories about US and UK state surveillance based on leaks from the NSA whistleblower Edward Snowden. None of that work involves committing, preparing or instigating acts of terrorism, or anything that could reasonably fall within even the most capacious definition of such activities. Yet anyone who imagines that Mr Miranda was detained at random at Heathrow is not living in the real world.

The reality about schedule 7 of the 2000 act is that it is a legal power tailored to the half-world of ports and airports. It gives police powers to do things to people in that half-world that they could not do in the real one. In the real world, legal checks and balances apply – in America, ironically, some of these go under the name of "Miranda rights". In the half-world, people can be held and questioned, searches carried out and property confiscated without particular suspicion or legal safeguards. There were 69,000 such stops last year, only a handful of which led to arrests.

Mr Miranda's detention was part security service fishing trip, part police harassment exercise and part government warning signal to journalists and whistleblowers. It was an attempt to intimidate journalism in one of the zoned-off jurisdictional spaces where such a thing can happen without legal redress. It was done simply because it could be done – and doubtless because the Americans wanted it done – and for no other reasons.

The detention of Mr Miranda subverts the benefit of the doubt that liberal democracies ask for when they arm themselves against terrorism. States pass anti-terror laws that grant exceptional powers on the strict understanding that terror poses exceptional threats and that such powers will be used proportionately. The Miranda detention betrays that understanding, since it does not involve terrorism in any way. Democratic leaders have likewise claimed to recognise the legitimacy of a public debate about the proportionate nature of the state's weaponry against terrorism. This case suggests the state takes us for fools.

Because of schedule 7's troubling history, parliament already has both a chance and a responsibility to prove otherwise. Schedule 7 should be radically tightened, so that exceptional powers are applied only in genuinely exceptional terror-related cases. Detentions should require reasonable suspicion. Confiscated materials should be returned quickly, where no charge is brought or national security involved, as fingerprints and DNA samples now are. Access to a lawyer should be allowed. If parliament rises to the occasion, perhaps some good may have come from what is otherwise a disgraceful episode of state harassment of independent journalism and free citizens.