Yes, but selling $150k of an investment to pay off that loan completely in itself is subject to capital gains, depending on how much of that is a gain. That’s on top of whatever other things have already been sold…
I for one, don’t really want to keep pushing my AGI up this year, especially when some planning of when I sell what investments, I can more or less control what my AGI is by spreading it out over a longer period of time…. sort of…with the exception of company issued stock, bonus, etc… which usually has some sort of time window you want to do things within.