Abdullah bin Abbas reported,

Sad is not among the obligatory prostrations, but I saw the Prophet ﷺ prostrate during it.

Azami 13175

Sahih

عن ابن عباس قال

{ص} ليس من عزائم السجود، وقد رأيت النبي ﷺ يسجد فيها.

الأعظمي 13175صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Tafsir of Surah Sad
Section
His saying, "He said, 'You have certainly been wronged by his request to add your ewe to his ewes. And indeed, many partners oppress one another, except those who believe and do righteous deeds, and few are they.' And Dawud became certain that We had tested him, so he asked forgiveness of his Lord and fell down bowing and turned in repentance. So We forgave him that, and indeed for him is nearness to Us and a good place of return." His saying "Indeed, we are" in the context of the trial of Dawud عليه السلام, there are many stories mentioned in books of tafsir transmitted from the Old and New Testaments that impugn the infallibility of the prophets, and none of them meet the standard of Jami al-Kamil, so I have disregarded them. And His saying "and fell down bowing and turned in repentance" means he prostrated to Allah and turned to Him in repentance
Numbering
Jami al-Kamil 13175 (2nd edition)
Azami 13175