Generally, you cannot legally be arrested for refusing to obey an unlawful order. Nothing I have read here provides any reason to think that the officer's order was legal, so refusing it also would have been legal. Nevertheless, you probably did the right thing by backing down. Making a report to the chief, however, is necessary.