Abdullah bin Abbas reported,

The Prophet ﷺ heard a man say, "Here I am at Your service on behalf of Shubrumah."The Prophet ﷺ asked, "Who is Shubrumah?"The man replied, "A brother of mine," or "a relative of mine."The Prophet ﷺ asked, "Have you performed Hajj for yourself?"He answered, "No."The Prophet ﷺ said, "Perform Hajj for yourself first, then perform it on behalf of Shubrumah."

Azami 4773

Sahih

عن عبد الله بن عباس

أن النبي ﷺ سمع رجلا يقول: لبيك عن شبرمة، قال: من شبرمة؟ قال: أخ لي أو قريب لي. قال: حججت عن نفسك؟ قال: لا. قال: حج عن نفسك، ثم حج عن ورة شبرمة.

الأعظمي 4773صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Hajj
Chapter
Obligation of Hajj, its virtue, and its conditions
Section
Prohibition of performing Hajj on behalf of the deceased by one who has not performed Hajj for himself
Numbering
Jami al-Kamil 4773 (2nd edition)
Azami 4773