Anas bin Malik reported,

The Prophet ﷺ passed by a very old man who was being supported as he walked between his two sons. He asked, "What is the matter with this man?"They said, "Messenger of Allah, he vowed to walk."He said, "Allah عز وجل has no need for this man to torment himself." So he ordered him to ride.Muhammad bin Muthanna reported to us that Ibn Abu Adi related from Humayd, from Anas, that the Messenger of Allah ﷺ saw a man, and he mentioned something similar. This hadith is authentic.

Tirmidhi 1537

Sahih

حدثنا أبو موسى محمد بن المثنى حدثنا خالد بن الحارث حدثنا حميد عن ثابت

عن أنس قال

مر النبي ﷺ بشيخ كبير يتهادى بين ابنيه فقال ما بال هذا قالوا يا رسول الله نذر أن يمشي قال إن الله عز وجل لغني عن تعذيب هذا نفسه قال فأمره أن يركب حدثنا محمد بن المثنى حدثنا ابن أبي عدي عن حميد عن أنس أن رسول الله ﷺ رأى رجلا فذكر نحوه هذا حديث صحيح

الترمذي 1537صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Vows and oaths
Chapter
One who vows to walk but is unable to
Numbering
Darussalam 1537
Tirmidhi 1537