The Prophet ﷺ prostrated during the recitation of Surah Sad and said, "Dawud performed this prostration as repentance, and we perform it as gratitude."
أخبرني إبراهيم بن الحسن المقسمي قال حدثنا حجاج بن محمد عن عمر بن ذر عن أبيه عن سعيد بن جبير
أن النبي ﷺ سجد في ص وقال سجدها داود توبة ونسجدها شكرا
[Its isnad is sahih] Tabarani reported it (Kabir, 12/34, no. 12386), and Daraqutni reported it from the hadith of Umar bin Dharr with this chain, and it is in Kubra, no. 1029, and Ibn Sakan graded it sahih, Talkhis Habir, 2/9, and it was also reported disconnected, but this does not harm it.