Reference: Majmoo’ Fataawa wa Maqaalaat Mutanawwi’ah – Volume 16, Page 373
Question: A person performed the obligatory hajj and afterwards he abandoned the prayer – and refuge is sought in Allaah – he then repented and began to perform the prayer. So is it obligatory for him to perform the hajj again, considering he had abandoned the prayer and [as is known] the one who abandons the prayer is a disbeliever? We anticipate [your] guidance [on this matter and] may Allaah reward you [with good].
Response: If the situation is as the questioner mentions, then his hajj is not nullified and he is not required to perform another hajj because righteous actions are only nullified if one dies upon disbelief (kufr). However, if Allaah guided him and he accepted Islaam and died upon Islaam, then indeed for him is what has preceded from [his] good [actions], for that which Allaah (‘Azza wa Jall) says in Soorah al-Baqarah (Aayah 217):
…and for what he (ﷺ said to Hakeem ibn Hizaam when he asked him about his righteous actions he did during [the time of] ignorance (pre-Islaam), will they benefit him in the Hereafter? So he ﷺ said to him:
And Allaah is the Expounder of all success.