The Messenger of Allah ﷺ said, "Were it not for the emigration, I would be one of the Ansar. And if the people took one mountain path or one valley, and the Ansar took another, I would take the path of the Ansar."
وقال رسول الله ﷺ لولا الهجرة لكنت امرأ من الأنصار ولو يندفع الناس في شعبة أو في واد والأنصار في شعبة لاندفعت في شعبهم
This is sahih, and it is in the individual Sahifah, number 56. The two Shaykhs did not narrate it through the route of the Sahifah. Bukhari narrated it in 13:196 of Fath, through the route of the Aaraj manuscript, with similar wording. He also narrated it with the same meaning in 7:86 [86], from the narration of Muhammad bin Ziyad from Abu Hurairah.