It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that a man asked the Prophet (peace and blessings be upon him), saying: "My father has died and he had not performed Hajj?" He (peace and blessings be upon him) said: "What do you think: if your father had owed a debt and you paid it off on his behalf, would it be accepted?" He said: Yes. He (peace and blessings be upon him) said: "Then perform Hajj on his behalf."
The wording of both routes is the same.
Imam al-Daraqutni (may Allah have mercy on him) narrated it like this in his book.
I say: Abbad bin Rashid (may Allah have mercy on him) was declared trustworthy (thiqah) by Imam Ahmad bin Hanbal (may Allah have mercy on him), while Ibn Hibban (may Allah have mercy on him) criticised him, and a number of the imams praised him. Abd al-Rahman bin Mahdi (may Allah have mercy on him) narrated from him, and the earlier scholars knew more about him than the later ones; and Allah knows best.
And Abu Sa'id (may Allah have mercy on him), the freed slave of Banu Hashim, also narrated it from Abbad bin Rashid (may Allah have mercy on him).