It is allowed to perform Hajj on behalf of someone who did not do so provided someone performed Hajj themselves.

The proof:

عَنِ ابْنِ عَبَّاسٍ، أَنَّ النَّبِيَّ صلى الله عليه وسلم سَمِعَ رَجُلاً يَقُولُ لَبَّيْكَ عَنْ شُبْرُمَةَ ‏.‏ قَالَ ‏”‏ مَنْ شُبْرُمَةَ ‏”‏ ‏.‏ قَالَ أَخٌ لِي أَوْ قَرِيبٌ لِي ‏.‏ قَالَ ‏”‏ حَجَجْتَ عَنْ نَفْسِكَ ‏”‏ ‏.‏ قَالَ لاَ ‏.‏ قَالَ ‏”‏ حُجَّ عَنْ نَفْسِكَ ثُمَّ حُجَّ عَنْ شُبْرُمَةَ

Narrated Abdullah ibn Abbas (may Allah be pleased with him):

The Prophet (ﷺ) heard a man say: Labbayk (always ready to obey) on behalf of Shubrumah. He asked: Who is Shubrumah? He replied: A brother or relative of mine. He asked: Have you performed hajj on your own behalf? He said: No. He said: perform hajj on your own behalf, then perform it on behalf of Shubrumah

[Saheeh Sunan Abi Dawood no. 1811]

Hafidh Ibn ‘Abdul-Barr rahimahullah said:

“And in this Hadith is also evidence for the permissibility of a man making Hajj for another person”

[Tamheed (9/134)]

He also said: “Malik said: It is allowed to make Hajj for a deceased who did not make Hajj himself. However, it is preferred that he perform Hajj himself first. This is the statement of Abu Haneefah, ath-Thawri, and al-‘Awzaai’. al-Hasan as-Saalih said: He does not make Hajj for himself except the one who made Hajj himself”

[Tamheed (9/136)]

And Allah Knows Best

Faisal Ibn Abdul Qaadir Ibn Hassan
Abu Sulaymaan