OP, Understand this, I actually believe you. First, I admit, I think the duck thing is funny, however, I can honestly understand your curiosity, being from another country. Please understand the position the police are in. Your fellow students, more than one, it appears, notified police they felt you expressed an intent to enact a shooting on campus. They also must have advised the police you possessed a knife, since they asked about it. So the police show up, anticipating you are soon going to be committing a major criminal act. In their eyes, you have hidden the gun, before they arrived and stashed the knife, to appear innocent.
From their position theoretically...
If they walk away, you might still do the act, if you had one planned. Perceptually, if you failed to convince them you posed no threat, they probably felt the need to take some action to prevent what you might be planning.
Do I think you received a raw deal? Yes.
Do I blame any of those officers for making the best decision they could in a bad situation? No.
Do I think they discriminated against you based on your race? No.
Do I think you need to stay away from the group of students that started this? Yes.
Do I think you knew these people were this screwy before this incident and elected to continue in the group? Yes.