The Minchas Yitzchok (1:54:1) cites the Da’as Kedoshim who writes, that just like Chazal (Kiddushin 66b) darshen based on the pasuk, ברך ה 'חילו ופועל ידיו תרצה, that if a kohen does the avodah, and then he realizes that he was actually a pasul kohen, retroactively his avodah is kosher. Similarly, in a case when one discovers his tefillin were pasul, retroactively it is considered as if they were kosher. Moreover, one doesn’t need to say “boruch shem” on any berachos that he recited over the pasul tefillin, as we look at it, as if they were retroactively kosher and they only became pasul now.
The Minchas Yitzchok points out that the Da’as Kedoshim is saying two big chiddushim: 1) That it is considered that one never made a berachah levatolah, and 2) That one can fix a berachah levatolah by reciting “boruch shem”, even many years after one said the berachah (although, in our case there is no need). On the second chiddush, the Minchas Yitzchok is very unhappy, as “boruch shem” only works straight away.
Another difficulty with the Da’as Kedoshim, which the Tzitz Eliezer (22:1) raises, is that the chiddush of ברך ה 'חילו, is a special pasuk said in regard to the avodah, who said it can be stretched to other areas of halachah. If one eats matzah on Seder night made from soybean flour as he thought that was ok, are we going to say it’s magically considered matzah because of ברך ה 'חילו?!