Yes, you were robbed and that sucks!!
I too, for the first time ever (1st trip 1996) had ganja taken from me by undercover (yes, I asked for ID).
(Short version of story)
Some renta was in my ear and I believe he was selling ganja, the cop for some odd reason thought I was holding the stash for the renta.
According to the cop, because I cooperated he let me go FREE, but kept the ganja of course.