The law also says they can detain you for 24 hours without any reason and on suspicion alone. The fact he approached them, placed him in the offensive. In some cases they could have gotten away with detaining him, claiming to assume the worst. Then it would have been up to him to prove otherwise.
If he would have been rude about it or a minority he probably wouldn't have faired well.