Who Are You Going to Trust, Me or Your Lying Eyes?

Speaking of denying reality to violate Mitzvos, see the wonderful example of the Rambam, in Yesodei Hatorah, end of chapter 8:

לפיכך אם עמד הנביא ועשה אותות ומופתים גדולים ובקש להכחיש נבואתו של משה רבינו אין שומעין לו ואנו יודעין בבאור שאותן האותות בלט וכשוף הן לפי שנבואת משה רבינו אינה על פי האותות כדי שנערוך אותות זה לאותות זה אלא בעינינו ראינוה ובאזנינו שמענוה כמו ששמע הוא.

הא למה הדבר דומה לעדים שהעידו לאדם על דבר שראה בעיניו שאינו כמו שראה שאינו שומע להן אלא יודע בודאי שהן עדי שקר לפיכך אמרה תורה שאם בא האות והמופת לא תשמע אל דברי הנביא ההוא שהרי זה בא אליך באות ומופת להכחיש מה שראית בעיניך והואיל ואין אנו מאמינים במופת אלא מפני המצות שצונו משה היאך נקבל מאות זה שבא להכחיש נבואתו של משה שראינו וששמענו.

Translation from Chabad.org:

Therefore, if a prophet arises and attempts to dispute Moses’ prophecy by performing great signs and wonders, we should not listen to him. We know with certainty that he performed those signs through magic or sorcery. [This conclusion is reached] because the prophecy of Moses, our teacher, is not dependent on wonders so that we could compare these wonders, one against the other. Rather we saw and heard with our own eyes and ears as he did.

To what can this be compared? To witnesses who gave testimony concerning a matter to a man who had observed the situation with his own eyes. He will never listen to them and will know for certain that they are false witnesses.

Therefore, the Torah states (Deuteronomy 13:3-4) that “[Even] if [such] a sign or wonder will come, you should not listen to the words of that prophet.” He comes to you with signs and wonders to deny what you saw with your own eyes. We believe in a wonder [as evidence of a prophet’s reliability] only because of the mitzvah which Moses commanded us. Therefore, how can a wonder [cause us to] accept this [person] who comes to deny the prophecy of Moses which we saw and heard?