To my understanding, this is how re-advanceable mortgages work: the mortgage portion and the HELOC portion are separate. But, as soon as you make a repayment on the mortgage, your available borrowing limit on the HELOC increases.
This separation is useful, for example, when implementing the Smith Manoeuvre, as you need to keep track of the interest paid on the money borrowed to invest.
However, when renewing, the amount you owe on the HELOC might be incorporated into the mortgage, especially if you switch to a lender that doesn't offer re-advanceable mortgages.