There was a riding-mount, either a she-camel or a camel, carrying some of the people's belongings, with a slave-girl riding upon it. They passed between two mountains, and the path became narrow for them. The slave-girl caught sight of the Messenger of Allah ﷺ and said, "Move on, move on. Allah, curse her!"The Prophet ﷺ said, "Whose slave-girl is this? No riding-mount, she-camel, or camel that carries upon it the curse of Allah shall accompany us."
حدثنا محمد بن أبي عدي عن سليمان عن أبي عثمان
كانت راحلة أو ناقة أو بعير عليها بعض متاع القوم وعليها جارية فأخذوا بين جبلين فتضايق بهم الطريق فأبصرت رسول الله ﷺ فقالت حل حل اللهم العنها فقال النبي ﷺ من صاحب هذه الجارية لا تصحبنا راحلة أو ناقة أو بعير عليها من لعنة الله تبارك وتعالى
Its isnad is sahih, Sulayman is Taymi, and Abu Uthman is Nahdi. The hadith was narrated by Muslim, 4/2005, no. 2596, in the Book of Righteousness, on the prohibition of cursing animals. And Abu Dawud, 2/26, no. 2561 (Dar al-Hadith edition). And Darimi, 2/288, in the Book of Seeking Permission, on the prohibition of cursing animals. And Bayhaqi, 5/254.