And unfortunately the education system encourages this. We all know that grades incorporate a lot of things besides understanding of the subject matter - typically you'll have multiple graded tests and quizzes which record the rate at which you learn material, often assignments are graded based at least in part on timely completion, most courses offer either a curve, extra credit, or both to boost grades, and of course there's a massive benefit to simply being a good test taker. Further, every teacher grades their classes differently such that A in one class can't be directly compared to another, even in the same subject matter. And yet, major life altering decisions such as what schools you can attend, what scholarships are available, what internships you can do, and where you'll be able to start your career after school are all heavily influenced by a single number which is determined solely by letter grades.
Of course in the real world we need cutoffs and there is no perfect way to measure understanding, it's just that we know grades to be such an obviously poor proxy, and it's way over used. We should have a way to distinguish "disciplined and hard working but doesn't know shit about this topic" from "clearly knows their stuff but snores a little too loud in the back"