A man asked the Prophet ﷺ, "My father has reached the age of Hajj, but he is an elderly man who cannot stay firmly on his mount. If I tie him to it, I fear he will die. May I perform Hajj on his behalf?"The Prophet ﷺ replied, "Tell me, if your father owed a debt and you paid it off, would that count for him?"The man said, "Yes."The Prophet ﷺ said, "Then perform Hajj on behalf of your father."
أخبرنا مجاهد بن موسى عن هشيم عن يحيى بن أبي إسحق عن سليمان بن يسار
أن رجلا سأل النبي ﷺ أن أبي أدركه الحج وهو شيخ كبير لا يثبت على راحلته فإن شددته خشيت أن يموت أفأحج عنه قال أرأيت لو كان عليه دين فقضيته أكان مجزئا قال نعم قال فحج عن أبيك
Sourced. [hasan] It is in Sunan al-Kubra, hadith no. 3620. Hushaym narrated with "an" and he conceals his sources, as Nasai said (Siyar Alam Nubala 74/7). His hadith has corroborating witnesses, among them the previous hadith. This hadith and the following hadith are both sahih and preserved, and Allah knows best.