Found a severe error in a conference paper after presentation but before the proceedings
Let's see:
- You wrote a paper of sufficient writing quality that it was chosen for presentation at a conference and publication.
- None of the peer reviewers noticed anything wrong with it.
- None of the people in the audience questioned it.
- Your supervisor saw nothing wrong with it.
- You gave an excellent presentation.
- You found a flaw in a paper that had already been accepted for publication.
- You had the integrity to withdraw your paper from publication.
That's a long list of things to put on your "plus" list. Most undergrads don't achieve even one of them. None of them should be seen as a negative.
Be warned that you'll become more jaded as you progress.
I remember as a grad student being asked by my supervisor to review a paper that had been sent for him to review. It was well written and obviously the result of a lot of hard work, but I found a fundamental oversight that would have allowed the entire problem to be reduced to something very trivial.
We told the publishers about this, and they wrote back requesting that we recommend it for publication anyway. My supervisor said that the author could publish another paper later that would re-analyze the problem and present it differently.
That's one (of many) reasons I eventually didn't bother finishing my own PhD.
Relax. You're not the first person to make a mistake, and people are not likely to know that you had been celebrating (besides, even if you were ... so what?). The fact that you found the error yourself is furthermore a good sign, since it means you're taking your work seriously and subjecting it to the scrutiny it deserves.
Take a look at this. The first direct evidence for dark energy goes back to the late 1990s, when two groups claimed to have discovered it. This was a big deal since dark energy supposedly makes up ~70% of the energy content of our universe. After follow-up work confirmed it, the 2011 Nobel Prize in Physics was awarded to the discoverers.
And then in 2019, we get this paper:
Thus the cosmic acceleration deduced from supernovae may be an artefact of our being non-Copernican observers, rather than evidence for a dominant component of “dark energy” in the Universe.
In other words: the paper claims the discovery was wrong. Let's say that again: this recently-published paper claims that the 2011 Nobel Prize in Physics was awarded incorrectly.
Imagine you are one of the three 2011 Nobel laureates in physics who's been celebrating for 8 years, and this result turns out to be robust. Is your reaction:
- Yay! Our knowledge of the universe has advanced yet again! Or is it:
- Oh my God, people are going to look at me and think I'm an embarrassing failure. I've been celebrating for twenty years, given plenty of talks discussing my results, even won a Nobel Prize, and my work is wrong. Panic!
I think most people will think the second reaction is pretty silly. If you think so too, then listen to your supervisor, who's a much more experienced academic than you and should know what to do. Perhaps there's something you can salvage from the work, which might make it less interesting but still a solid result, for example. Or perhaps the method you used can be adapted to a different problem. Either way, you've learned something. If you stay in research, you'll be meeting this kind of issue often, so don't worry too much about it.
There is one other thing you can consider doing, after getting agreement from the conference committee.
You can put a note in the paper for publication, noting that you have found a serious error and explaining the nature of the error. Don't bother with apologies and such, but just point out where the paper is wrong.
This assumes, of course, that you don't have a correction. If you do, then a corrected version for publication would be better.
As your advisor notes, withdrawing it from publication is also a good plan, but a notice that you can honestly evaluate a failed result is valuable to those who have already seen the work (at the conference) and might want to see the outcome.
But yes, relax. Any errors here are shared with a lot of people.