Just to re-emphasise that CFCs and leaded petrol were bad, if you like, for two different reasons. Leaded petrol in particular was a travesty: it was well-known that lead was poisonous, and it took no time at all for workers at the factory to die as a result of fatal lead exposure. But the industry simply hushed that up and started one of the most dishonest and destructive campaigns in history to try and portray lead as somehow beneficial in the face of all the evidence. But that was a matter of money talking, rather than science. It's simply a complete fabrication, then, to suggest that there was any "consensus" that leaded petrol was safe. The problem was ignored, until somebody noticed it by pure accident when they were investigating a completely different project.
CFCs, on the other hand, were bad because they were new and their effects were not properly understood. I am not sure of the full timing but I suspect that the ability to observe and closely monitor the ozone layer is comparatively recent, even if the existence layer itself was already known. No-one could have plausibly foreseen that CFCs would be so destructive to ozone, and Midgley and others can be forgiven then for developing and producing it. The "consensus" in this case, such as it existed, was therefore built of ignorance rather than evidence: there was clearly no basis for the conclusion that CFCs were safe, but nor had there been sufficient research to establish its possible risks.
Then that research happened, in what I can only describe as a surprise or a shock to the original discoverers of the ozone hole; and once it was tracked down, of course the industry again resisted -- and indeed still resists, to a limited extent -- any attempts to take the obvious step of removing CFCs from use.
Both of the stories, then, do not demonstrate even remotely a failure of the scientific consensus. I'm sure you can find examples where the consensus genuinely *has* failed, mind -- but when it comes to environmental impacts, the story is almost invariably that the scientists, more or less quickly, discover the problem, and then the politicians refuse to take the necessary action because it would be "too expensive", which means that their main source of campaign funds wouldn't wear it.