Question :
Is it from Sunnah that the person, who said "Sami`a Allahu liman hamidah" instead of "Allahu Akbar" or vice versa, should do the prostration of forgetfulness (sujood as-sahw)?
The Answer :
An-Nawawi (May his soul rest in peace) said, "One who leaves some Sunnan of prayer (deliberately or forgetfully), such as Ista'aadha (Audhu Billahi mina-Shaitan-nir-Rajeem), the opening invocation, raising hands, making Takbeer, Tasbeeh…………………isn`t obliged to do the prostration of forgetfulness. This is because it wasn`t reported that the Prophet (PBUH) had ever done the prostration of forgetfulness for any of the above Sunnan. This is in addition to the fact that the prostration of forgetfulness is an addition to the prayer. Therefore, it may not be offered in these situations save with an evidence from Sharia.
In conclusion, it isn`t permissible for the one who said "Sami`a Allahu liman hamidah" instead of "Allahu Akbar" to do the prostration of forgetfulness. However, if he did this prostration although he knows that it isn`t permissible, then his prayer is rendered invalid. And Allah knows best.