Only if they realize those gains.
There is a reason that investment firms exist: this process is a ratchet for making untaxed (or less-taxed) income.
If you pay them with income, you paid income tax.
If you pay them by liquidating assets (including assets you purchased with the loan money and then sold), you pay capital gains tax (unless you sell for a loss).