Ali arrived from Yemen, and the Prophet ﷺ asked him, "With what intention did you enter ihram?"He replied, "I entered ihram with the same intention as the Messenger of Allah ﷺ."The Prophet ﷺ said, "Were it not that I have the sacrificial animal with me, I would have exited ihram."
حدثنا بهز حدثنا سليم بن حيان قال سمعت مروان الأصغر يحدث
أن عليا قدم من اليمن فقال له النبي ﷺ بم أهللت فقال أهللت بما أهل به رسول الله ﷺ فقال فإني لولا أن معي الهدي لأحللت
Its isnad is sahih. Salim bin Hayan is trustworthy, and Marwan the Younger, or as some say al-Asfar, which is an error, is Ibn Khaqan, as they have said. The hadith has already appeared at 12387 with similar wording.