You had every right to open carry and he was in the wrong. The problem is you handled it very badly from the beginning. You let an uneducated, no it all officer take away your rights for a brief moment. You were just another sheep and by you cowering down you just incouraged this officer to try this again.
STAND UP FOR YOUR RIGHTS SON!