It is narrated from Sayyiduna Abdullah bin Ja'far (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever is in doubt about his prayer, let him perform two prostrations after giving the salam."
There is no harm in this chain, except that the hadith of Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) is more authentic in its chain than it, and with it are the hadiths of Sayyiduna Abd al-Rahman bin Awf and Sayyiduna Abu Hurayrah (may Allah be pleased with them both), as we shall mention. Wallahu a'lam (And Allah knows best).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3821
Sayyiduna Thawban (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "For every lapse of forgetfulness there are two prostrations, after giving the salam."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3822
This chain contains weakness. The hadith of Sayyiduna Abu Hurayrah and Sayyiduna Imran (may Allah be pleased with them both) concerns several lapses of forgetfulness occurring together for the Prophet (peace and blessings be upon him), and his (peace and blessings be upon him) limiting himself to only two prostrations contradicts this hadith.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3823
(a) Ziyad bin Ilaqah (may Allah have mercy on him) narrates that Sayyiduna al-Mughirah (may Allah be pleased with him) led us in prayer and stood straight up after two rak'ahs. We said 'Subhan Allah' (Glory be to Allah), and he too said 'Subhan Allah' (Glory be to Allah) and carried on praying. When he had completed his prayer and given the salam, he performed the two prostrations of forgetfulness. Then he turned to us and said: This is how I saw the Messenger of Allah (peace and blessings be upon him) do it.
(b) Imam al-Bayhaqi (may Allah have mercy on him) said: The hadith of Sayyiduna Ibn Buhaynah (may Allah be pleased with him) is more authentic than this, and with it is the narration of Sayyiduna Mu'awiyah (may Allah be pleased with him); in their hadith, the Prophet (peace and blessings be upon him) performed the two prostrations before the salam. Wallahu a'lam (And Allah knows best).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3824