:sl:
First of all it is not any type of Hajj that forgives sins, it is only a Hajj Mabruur a Hajj that is accepted. Furthermore, when a person does a sin yet whilst doing it they say I will ask Allahs forgivness later on this will make tawbah void later on, do you not remember the story of Yusuf and his brothers when they said:
اقْتُلُواْ يُوسُفَ أَوِ اطْرَحُوهُ أَرْضًا يَخْلُ لَكُمْ وَجْهُ أَبِيكُمْ وَتَكُونُواْ مِن بَعْدِهِ قَوْمًا صَـلِحِينَ
Imaam
ibn Kathir said:
Kill Yusuf or cast him out to some (other) land, so that the favor of your father may be given to you alone,) They said, `Remove Yusuf, who competes with you for your father's love, from in front of your father's face so that his favor is yours alone. Either kill Yusuf or banish him to a distant land so that you are rid of his trouble and you alone enjoy the love of your father.
(and after that you will be righteous folk.), thus intending repentance before committing the sin,
And in such a way Allah did not accept their repentance at that particular time, rather it was only when they truly repented and asked their father to make dua on their behalf that Allah answered their request of repentance.