The Prophet ﷺ prostrated during Surah Sad and said, "Dawud performed this prostration as an act of repentance, and we perform it as an act of gratitude."
أن النبي ﷺ سجد في {ص}، وقال: سجدها داود عليه السلام توبة، ونسجدها شكرا.
Nasai narrated it in Al-Kubra (11374) from Ibrahim bin Hasan, who said, Hajjaj bin Muhammad narrated to us, from Umar bin Dharr, from his father, from Saeed bin Jubayr, from Ibn Abbas, and he mentioned it. Its chain of transmission is sahih. Dharr is the son of Abdullah Al-Marhabi, one of the narrators found in all the major hadith collections.