It works the opposite way too.
My one and only court appearance I was the only sentencee wearing a suit. Everyone else was wearing casual/pajama type clothing to the point the judge even brought it up himself.
“Well you look very nice Mr. Weirdguy. I wish more people realized this is supposed to be a formal occasion”
He then gave me the absolute minimum sentence possible for what I was there for.
Ellen Ripley from the Alien series.