After I retired I managed a retail store for several years. At least once per month I would be in court to testify regarding theft or other charges I had to levy against somebody and I always wore slacks, a sport coat, and tie.
Except for me, the only other people who dressed up were the lawyers, prosecutors, and the court employees. I do not remember ever seeing a defendant or anyone sitting in the court wearing appropriate attire. It amazed me as to how casual most people are when inside a court of law, even the people who may end up in jail.
Customs change over time.
One era’s casual clothing is the next era’s formalwear.
A few generations down the line and nobody even owns what was their grandparents Sunday best.