Moreover, in the examples you give clothes also serve a practical use within the game itself, except maybe golf not as significantly. But golf is also another peculiar case of a sport and one that carries different traditions. Eg esp for BJJ I would say clothes are important part of the game in ways that it is not for chess.
I agree that FIDE’s dress code is prob more similar to dress code of social activities like bridge. But I would also expect some people to get confused over how strict these are from time to time, and ppl certainly do not become grandmasters by memorising dress code rules. This has happened before anyway and ppl did not think it was an intentional act of activism to dress in shorts either [0].
[0] https://www.chess.com/news/view/dress-code-incident-at-world...
Many other social activities which you may not call sport have dress codes too. On the top of my head, I can think of Bridge or Snooker. Nothing really fundamentally peculiar with Chess. I don't blame Carlsen for asking to review the rules though.