Sunan Ibn Majah 1212
سنن ابن ماجه#1212SahihIt was narrated that ‘Abdullah said:“The Messenger of Allah (ﷺ) said: ‘If anyone of you is uncertain about his prayer, let him try to do what is correct then let him prostrate twice.’” Tanafisi said: "This is the basic rule, and no one is able to reject it
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Al-AlbaniSahih
Muhammad Fouad Abd al-BaqiSahih
Shuaib Al ArnautSahih
Zubair Ali ZaiSahih
In-book reference: 5:410