My question is whether this has happened before in modern science. If it hasn't, then denialists have to get us to assume pretty heroically that the scientific process has failed in a way that it's not failed before, and I think it might make us consider whether in fact, the denialists are wrong and the 97% of climatologists are right.
I should note that this isn't about science getting something wrong - that happens all the time. This is about the claim that the field of climatology is fundamentally unsound, which is the basic claim of denialists. And even if it did happen elsewhere, that doesn't mean it's happening now in climatology, but the precedent would make the claim a tiny bit less implausible.
I looked once before at whether modern science engages in conspiracy, in the far smaller group of scientists examining Jupiter's moon Europa and its ice cover, and I didn't think it was helpful to denialists.
So how about another potential example, in the field of evolutionary psychology. This area attracts a lot of controversy, possibly because amateurs try to use it to as a pop-scientific justification of whatever moral belief they advocate, possibly because its supporters sometimes overstate some of their conclusions, and possibly because biologists don't like psychologists encroaching on their turf. But is the field discredited?
The short answer is no, at least not the way that climate denialists think that 97% of climatologists are wrong. Even critics of many papers published on evolutionary psychology think the field can reach and has reached appropriate conclusions, like Jerry Coyne:
Now I don’t oppose evolutionary psychology on principle. The evolutionary source of our behavior is a fascinating topic, and I’m convinced that the genetic influences are far stronger than, say, posited by anti-determinists like Dick Lewontin, Steve Rose, and Steve Gould. Evolved adaptations are particularly likely to be found in sexual behavior, which is intimately connected with the real object of selection: the currency of reproduction. I’m far closer in my views on this topic to Steve Pinker than to Steve Gould. And there are many good studies in the field, so I don’t mean to tar the whole endeavor.
It's also worth noting that compared to climatology, evolutionary psychology is a "soft" scientific field with ethical barriers to experimentation that climatology doesn't experience. Even so, aside from the view of possibly a tiny number of critics, it's not gone as far off the rails as denialists claim has happened for climatology. The denialists are going to have to look somewhere else for a precedent.
Personally, I think evolutionary psychology is fascinating and likely to have significant insights. I think it's facetious to believe that in our psychology, which is crucial to our survival, we'd have escaped the evolutionary influences that affect every other species on the planet. Great apes are clearly smart enough to have differing individual psychologies that must have affected their survival rates over time. Getting deep and subtle insights about human evolutionary psychology will be difficult, but denying that field's validity is as about as smart as climate denialism.