The Messenger of Allah ﷺ performed the bowing in the prayer, then raised his head and said, "Ghifar, may Allah forgive them. Aslam, may Allah keep them safe. Usayyah has disobeyed Allah and His Messenger. O Allah, curse Banu Lihyan. O Allah, curse Ril and Zakwan." Then he said the takbir and fell into prostration.Khufaf said, "So the cursing of the disbelievers was instituted because of this."
قال حدثنا يزيد بن هارون قال أخبرنا محمد بن إسحاق عن خالد بن عبد الله بن حرملة عن الحارث بن خفاف
ركع رسول الله ﷺ في الصلاة ثم رفع رأسه فقال غفار غفر الله لها وأسلم سالمها الله وعصية عصت الله ورسوله اللهم العن بني لحيان اللهم العن رعلا وذكوان ثم كبر ووقع ساجدا قال خفاف فجعلت لعنة الكفرة من أجل ذلك
Its isnad is sahih. Khalid bin Abdullah bin Harmala Mudliji Hijazi is among the trustworthy Followers, and he used to narrate with omitted links, but here he did not omit anything, so his hadith is sahih, and it is like the one before it.