It was narrated from ‘Alqamah that Ibn Mas’ud prostrated twice for the prostrations of forgetfulness after the Salam, and he mentioned that the Prophet (ﷺ) did that.”
Sunan Ibn Majah Book 5, Hadith 416