Ali bin Abu Talib reported,

The Prophet ﷺ sent out a military expedition and placed a man from the Ansar in command, ordering them to obey him. The commander became angry and asked, "Did the Prophet ﷺ not order you to obey me?"They replied, "Yes."He said, "Then gather firewood for me."So they gathered it.He said, "Light a fire."So they lit it.Then he said, "Enter it."They were about to do so, with some holding others back, saying, "We fled to the Prophet ﷺ from the Fire." They kept at this until the fire died down and his anger subsided.When this reached the Prophet ﷺ, he said, "Had they entered it, they would never have come out of it until the Day of Resurrection. Obedience is only in what is right."

Azami 9091

Sahih

عن علي قال

بعث النبي ﷺ سرية فاستعمل رجلا من الأنصار، وأمرهم أن يطيعوه، فغضب فقال: أليس أمركم النبي ﷺ أن تطيعوني. قالوا: بلى. قال: فاجمعوا لي حطبا. فجمعوا، فقال: أوقدوانارا فأوقدوها، فقال ادخلوها فهموا، وجعل بعضهم يمسك بعضا، ويقولون: فررنا إلى النبي ﷺ من النار. فما زالوا حتى حمدت النار، فسكن غضبه، فبلغ النبي ﷺ فقال: لو دخلوها ما خرجوا منها إلى يوم القيامة، الطاعة في المعروف.

الأعظمي 9091صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expeditions that occurred after the conquest of Khaybar and before Amra al-Qadiyyah
Section
Expedition of Abdullah bin Huzafa bin Qays bin Adi Sahmi, who was among the Muhajirun
Numbering
Jami al-Kamil 9091 (2nd edition)
Azami 9091