At university level, the grades are more accurate (but still flawed) because the grade is typically 70-80% test and quiz based.
My experience in the US with grades for middle school and high school is that it's 85-90% non-examination based-- Meaning it's essentially a measure for how well you can complete and turn in the busy work on time.
That's a great measure for conscientiousness, but the standardized tests will show who actually learned the material.
"When a measure becomes a target, it ceases to be a good measure."
Your point is still valid though, I find university test scores more "accurate" too, whatever that means for learning.
My wife grew up with a lot of testing in asia. Now working as a teacher in northern europe she finds the approach here way better for actually learning, where there's less focus on memorizing things, and more on problem solving. The thing is, it's harder to make tests for problem solving, so tests tend to favor memorizing, especially when there's a lot of it. It's not just about making the questions, it's about grading them and making a judgement about whether the student took the right approach despite getting the wrong answer. How do you standardize that?
I'm not sure what's standard, but at my university we often had exams with either formula books and/or a cheat sheet we could prepare ourselves. Yet the math tests were way more challenging for me than the simpler tests without access to material we had in high school.
[1]: https://www.miamiherald.com/news/local/education/article1952...