Then what if the test was how well you play chess? That takes time to study to become good. But would it be a good metric for hiring programmers?
But yeah, people used to ask that level of unrelated questions to programmers, and they were happy with the results. "Why are manhole covers round" etc. LeetCode style questions do produce better results than those, so that is why they use them.