The poskim discuss the unfortunate situation, of one who realizes after many years that the tefillin he has been wearing for many years are now pasul [disqualified]. Not only has he missed out on the mitzvas aseh of wearing tefillin for many years, but he has also made countless berachos levatolah [in vain]. What should one do in such a case, how can one do teshuva?
The Shu”t Panim Meiros (3:9) discusses a case when one found out after many years, that his tefillin shel rosh [head tefillin] was pasul. The Panim Meiros writes, that in regard to the bitul mitzvas aseh which was done accidentally, viduy helps. In regard to the berachah levatolah, the is a machlokes Rambam and Tosfos if it is de’O’raisa or derabonon, however, we pasken it’s derabonon. Additionally, nowadays, we say “boruch shem” after the berachah recited on the tefillin shel rosh, therefore, it’s not considered a berachah levatolah. Even if the case would be the other way round and the tefillin shel rosh were kosher and the tefillin shel yad were pasul, it still wouldn’t be a berachah levatolah. According to our minhag that we make two berachos when putting on tefillin, the berachah on the tefillin shel yad goes on the tefillin shel rosh as well, therefore, even if the tefillin shel yad is pasul the tefillin shel rosh is ok, therefore, it is not considered a berachah levatolah.