The compiler "guessed" your errors. This does not mean the compiler "knows" your errors. A rephrase of your question is -- Why compilers don't always assume the "guessed" correction of your code? This is because compiler doesn't know and you won't know when it may guess wrong. And in the case of guessing wrong, you will have very very mysterious errors to the best, and have very very mysterious wrong application behavior (that doesn't even fail) to the worst.
Actually, when I was teaching, I used to see a student strategy I called “obey the compiler”, which was to fix whatever the compiler complained about, without thinking. If the compiler said “semicolon expected at col 42”, the student would put a semicolon at column 42. If the compiler complained “undeclared identifier prnit_results”, the student would declare a name prnit_results. The strategy, when followed to extremes, could convert an almost-valid program into a string of nonsense (post-conversion was when the student came to me for help), more or less the opposite of PL/C's strategy, which I mentioned in an earlier comment. To be fair, this strategy was mostly found in first-year, and a few weaker second-year students.