Shaykh Ibn Baz explains that Hajj is valid even if a person has debt, but clearing the debt should be prioritized. Hajj is only obligatory for those who are able, while repaying debt is obligatory, so one should settle debts first unless they can do both together.
Is Ḥajj valid [if performed] before clearing debt?
Yes, Ḥajj is valid and there is no problem even if a person has debt. However he should begin by clearing the debt before performing Ḥajj. Since Ḥajj is not obligatory upon the one who doesn’t have the ability, rather it is only obligatory upon those who are able. As for debt, then it is obligatory to clear it. So upon you is to begin with clearing the debt unless you have the ability to clear the debt and perform the Ḥajj together then all praise is due to Allah ﷻ.