I wouldn’t think saying “I do not consent to a search” is insulting or threatening, but I’m afraid that some cops take it that way.
And some people are just wise asses who are looking for a confrontation with the cops. You’re not going to win a legal argument with the cops in the field. Save it for the courtroom.