The Messenger of Allah ﷺ used to go to the Mosque of Quba both riding and on foot.
حدثنا أسباط بن محمد حدثنا محمد بن عجلان عن نافع
كان رسول الله ﷺ يأتي مسجد قباء راكبا وماشيا
Its isnad is sahih. Asbat bin Muhammad bin Abdul-Rahman, his reliability was already established at 1384, and we add here that Ibn Main and Yaqub bin Shayba and others also declared him reliable, and Bukhari mentioned him in al-Kabir 2/1/53-54. The hadith is a repetition of 5860, and see also 5999.