Yesterday, I noted how Chasam Sofer was of the view that the Sanhedrin may be mistaken in their rulings, and yet they must be obeyed, due to the importance of a centralized rabbinic authority. In this, he was following the approach of Sefer HaChinnuch (and, arguably, some others). Rav Yosef Caro, as explained by Rabbi Shlomo Fisher, takes the same approach to Chazal. Chazal could indeed be mistaken; nevertheless, we never dispute their rulings. This is because the Jewish People canonized the Gemara; we accept its binding authority, regardless of whether or not Chazal were correct. (Cases involving matters of life and death are an exception to this, as discussed previously).
In my book Sacred Monsters, I noted that Rav Yitzchak HaLevi Herzog applies this approach to the famous case of lice. The Gemara permits killing lice, on the basis that they (were believed to) spontaneously generate. Rav Herzog acknowledged that spontaneous generation had been rejected by modern science, and understood that the ruling permitting lice to be killed on Shabbos was based on this belief. Yet he nevertheless ruled that it is still permissible to kill lice on Shabbos:
…It is permissible to kill a louse on Shabbos, due to it not reproducing, as explained in Tractate Shabbos 107b, i.e. that since a louse does not come from a male and female but rather from sweat, it is not considered a creature such as to prohibit killing it on Shabbos… Although modern science, as far as I know, does not acknowledge the existence of spontaneous generation, for halachic purposes we have nothing other than the words of the Sages. (Rabbi Yitzchak Herzog, Heichal Yitzchak, Orach Chaim 29)
Until now, while I thought that this was also implicit in earlier sources, Rav Herzog was the only authority that I knew of to explicitly apply this approach with the case of lice. But I recently found another such source. Rabbi Moshe Shmuel Glasner (1856-1924) was chief rabbi of Klausenberg in Hungary, who was widely celebrated for his extraordinary commentary on Chullin entitled Dor Revi'i. He writes as follows:
Due to the canonization of the Oral Torah in writing, the statement that “[According to the law that they direct you… you shall do…] even if they say right is left” — by which the Torah instructed that the minority of a given generation is bound by the decision of the majority — applies now, after the completion of the Mishnah, Talmud, and the like, also between generations. This means that if a generation subsequent to the finalization of the Mishnah discovers that the authors of the Mishnah erred, or similarly, if a generation subsequent to the completion of the Talmud finds that the authors of the Talmud erred, we remain with the consensus of the earlier ones, whether this result in stringency or leniency. This is just as the Sefer HaChinnuch writes, that it is better to tolerate one error in one law, than to destroy, God forbid, the entire edifice. We cannot deviate from that which they established as law in the Mishnah or Gemara even regarding something based on science or other disciplines... Consider also that we rule that one is not liable for killing a louse on Shabbat (Orach Chaim 316:9), and that it is permissible to eat fruit and cheese that have developed worms, provided the worms have not separated from the fruit (Yoreh De’ah 84). These laws are founded upon the consensus of the Sages (Shabbat 107b) that these insects spontaneously generated rather than through sexual reproduction… Now in truth, the scientific consensus today is that there is no insect that does not procreate by means of eggs. Nevertheless, we shall not overturn the law, even in the name of stringency, against the ruling and consensus of our Sages… Once compelling need necessitated that the Oral Torah be canonized for future generations, we do not have the authority to change even the slightest detail which they decided and agreed upon, whether with regard to the explication of verses or matters relating to science, for all their Torah is holy to us, and one must not deviate from it… (Rabbi Moshe Shmuel Glasner, Dor Revi’i, Chullin, Introduction)
I don't know how I missed this source, all these years, but it's going to be in the next edition of Sacred Monsters! Thanks to Rabbi Dr. Edward Reichman for bringing it to my attention.