Peer review is regularly completely inadequate. As an example, consider the amyloid hypothesis for Alzheimer's, which just this week was likely discovered to be actively fraudulent after nearly 20 years, thousands of papers, and thousands of scientists spending their entire research careers on it.
We already know peer review isn’t perfect, but it’s also probably a lot better than the layman’s attempt to discriminate good science from bad. We don’t have a ton of data of how many papers are rejected either. But, one high profile example isn’t a particularly scientific way to establish that all of science is actively bad. It’s one bad example, and yes it’s awful that one case can have such wide ranging ramifications, but you’re downplaying the thousands of papers, and thousands of scientists who assumed the research was valid and did good faith work on top of it.
If anything, the practical reaction to your example should be that papers that go high profile need replication studies very quickly, not that we should assume as a lay person that all science is wrong.
Something like a third of all published studies fail to replicate in the worst offending fields, and even more fail to replicate at the original effect size or greater. The incentive structure of the entire institution is screwed. Pessimism is warranted here, if you open a journal you should keep in mind that for most fields there’s a double-digit chance that what you’re reading will fail to replicate at all and even more that it’ll fail to replicate at the same of greater effect size.
There are some tools which do this. scite.ai has proven okay for quickly finding some of these citations, sometimes. Nothing beats manually digging in, though.
The reason I say this is that there have been numerous cases where someone has tried to discredit one of my claims by citing a paper, and then I actually Sci-hub it and find out that the body of the study only weakly supports the conclusion, or that the study protocol contains a huge caveat not described in the abstract.