Covering up a mistake is perceived as dramatically worse than the mistake itself.
Discovering an error in a past publication can be a terrifying experience. However, if the mistake was genuinely unintentional, you should contact the journal to issue a correction/retraction. Doing so, and being as transparent as possible about the error, may even generate good will among your peers.
Professor Pamela Ronald from the University of California, Davis, was lauded by the scientific community for self-retracting two papers after she discovered that a bacterial strain had been mislabelled, invalidating the conclusions of the two papers.
A similar effect was reported in a 2017 study, wherein authors claimed that a self-retraction had not damaged their reputation and, in some cases, had improved it.
A 2013 study showed that a single retraction can result in reduced citations across an author’s entire publication record. However, this effect disappeared for self-reported errors.
An analysis of 2047 retractions in 2012 showed that 21% were due to unintentional errors. The consensus, at least in the West, is that authors who come forward themselves should be ‘cherished’ for their courage. Some have called for the creation of different terms to differentiate between papers retracted due to misconduct and those retracted due to honest error.
While time-consuming and emotionally taxing, self-correcting/retracting a flawed paper is the right thing to do and may even help build trust amongst your peers.