I had a similar situation some years ago. I was stopped, while on foot, and manhandled by someone claiming to be a CID police officer. The man explained there had been a robbery in the area and I resembled the description of a suspect. Earlier there had indeed been an alarm going and police in the area, which made the man seem plausible. After the incident I called the police and they sent an officer out to talk to me.
It emerged that the man who stopped me was NOT a plain-clothes police officer – the ID card he’d flashed was not a police one. But what was his motive? He didn’t try to rob me, he just held me against the wall and questioned me for 2 or 3 minutes, then let me go.