That is all fine if they detained a guy from another part of the city from where the robbery happened.
If a crime happened like 5 minutes ago and you are looking at someone who fits a description who is for example 200 meters away from the crime scene than it is unreasonable to not check him.
I am not from US, but I guess this can happen to everyone. There were no violence from either side and he was checked and released, which is unpleasant but it did not imply racism in any way in my opinion.