Here are a couple of examples in which young researchers submitted papers for publication which contained potentially embarrassing mistakes. But, rather than being put off by their mistakes and retiring into obscurity to to lick their wounds, both researchers were spurred into doing the work which made them famous.
While in his final year at school, however, Abel had begun working on the solution of quintic equations by radicals. He believed that he had solved the quintic in 1821 and submitted a paper to the Danish mathematician Ferdinand Degen, for publication by the Royal Society of Copenhagen. Degen asked Abel to give a numerical example of his method and, while trying to provide an example, Abel discovered the mistake in his paper.
Abel went on to prove that there is no general solution in radicals to quintic equations (the Abel-Ruffini theorem). In his book Finding Moonshine, Marcus du Sautoy suggests that Degen actually recognised that Abel's solution was flawed and, by asking for a numerical example, he was gently prompting Abel to look at his work again, without discouraging him.
When I first learned about the mutual exclusion problem, it seemed easy and the published algorithms seemed needlessly complicated. So, I dashed off a simple algorithm and submitted it to CACM. I soon received a referee's report pointing out the error. This had two effects. First, it made me mad enough at myself to sit down and come up with a real solution. The result was the bakery algorithm described in. The second effect was to arouse my interest in verifying concurrent algorithms.
Lamport's bakery algorithm was just the first of many important contributions he made in the field of concurrent algorithms.