You make this sound as if it is unusual -- but it's not really. Papers are discredited all the time, and it doesn't even mean they are bad papers.
When a question arises, papers are typically published on both sides of the question, and both sides of the question can't be right. Therefore peer review doesn't mean that a paper's position is correct or true, only that it's not trivially dismissable given the current state of knowledge. And that's how the state of knowledge advances, not just with brilliant, seminal papers that redefine the field in one stroke, but a through a cut-and-thrust process that sifts through existing evidence and generates new evidence.
This is why it is a bad idea for a layman to put any kind of trust in any one study, until long after that study has stood the test of time. Peer review can't tell you whether a paper is right, in fact it's not supposed to.