Answered by Sidi Moustafa Elqabbany
If one were to absentmindedly add an extra takbir to every rak’ah, would this invalidate the prayer? Should one perform the prostration of forgetfulness?
In the Name of Allah, Most Merciful and Compassionate. All praise is due to Allah, Lord of all things. May Allah bless and grant peace to our Master Muhammad, his family, and companions.
Merely saying “Allahu Akbar” when it is uncalled for, even if intentionally, will not invalidate the prayer. To quote Reliance, f9.3:
No form of invocation of Allah (dhikr) invalidates the prayer unless it is a direct address such as “Allah have mercy on you” or “And upon you be peace”; though it does not invalidate the prayer if it refers to someone not present, such as “Allah have mercy on Zayd” (O: nor is it invalidated by addressing Allah or the Prophet (Allah bless him and give him peace)).
One would not prostrate out of forgetfulness in this case. [Reliance, f11.5]
If one is in doubt whether or not to prostrate out of forgetfulness, the proper course of action is not to prostrate. [Reliance, f11.9] The prostration of forgetfulness is sunna, so omitting it will never invalidate the prayer. [Reliance, f11.12]
Allah the Exalted knows best and He alone gives success.
Moustafa Elqabbany
Metro Vancouver, Canada