Reference: I’laam al-Musaafireen – Question 16, Page 18
Question: I forgetfully prayed without [being in the state of] wudhoo, and after I finished [my prayer] I remembered; so am I required to repeat the prayer?
Response: Yes; whoever forgetfully prayed without [being in the state of] wudhoo is required to repeat the prayer. This is based upon the statement of the Prophet ﷺ:
«Allaah does not accept the prayer of the one who has invalidated his wudhoo until he makes wudhoo» – transmitted by al-Bukhaaree
…in contrast to the one who forgetfully prayed in an impure garment, then he does not have to repeat [the prayer]. That is because Jibreel came to the Prophet ﷺ while he was praying, and informed him that he had some filth on his sandals[1], so he removed them and continued with his prayer; which indicates that the one who is unaware of an impurity or has forgotten about it is not required to repeat [the prayer].
Footnote:
[1] Transmitted by Ahmad in his Musnad, and Abu Daawood.