The Prophet ﷺ said regarding the prostration in Surah Sad, "The Prophet of Allah Dawud performed it as repentance, and we perform it as gratitude."
أن النبي ﷺ قال في سجدة {ص}: سجدها نبي الله داود توبة، وسجدناها شكرا.
Nasai (957) narrated it from Ibrahim bin Hasan Miqsami, who said, Hajjaj bin Muhammad told us, from Umar bin Dharr, from his father, from Saeed bin Jubayr, from Ibn Abbas, who related it. Its chain of transmission is sahih.However, Bayhaqi (2/319) criticized it for being a mursal report, saying, Shafii narrated in his earlier work, from Sufyan bin Uyayna, from Umar bin Dharr, from his father, and related the hadith. He said, "This is what is preserved as mursal. It has been narrated from Umar bin Dharr, from his father, from Saeed bin Jubayr, from Ibn Abbas, as a connected chain, but that is not strong."I say, it is not as he said, for the one who connected it was Hajjaj bin Muhammad, who is Masissi, the one-eyed, one of the trustworthy and precise imams. Imam Ahmad said of him, "How precise he was, and how firmly he adhered to the exact wording." His standing was raised very highly, so an addition from someone like him is accepted according to the principles of the hadith scholars.