I can't say for sure, but I'm not even sure TD Ameritrade would make this determination. I don't think a wash-sale would be determined until you complete your related taxes. Don't quote me on that, but that's my gut feeling since I've never been in this situation.
This article will answer your question though (you can avoid the wash-sale rule with your proposed method):
https://www.investopedia.com/terms/s/substantiallyidenticalsecurity.asp
For example, if an investor sells the SPDR S&P 500 ETF (SPY) at a loss, they can immediately turn around and purchase the Vanguard S&P 500 ETF.9 Tax-loss harvesting has become increasingly popular as algorithmic trading and investment management services such as robo-advisors are able to tax loss harvest on your behalf automatically.10 11
The rationale is that the two S&P 500 ETFs have different fund managers, different expense ratios, may replicate the underlying index using a different methodology, and may have different levels of liquidity in the market. Presently, the IRS does not deem this type of transaction as involving substantially identical securities and so it is allowed, although this may be subject to change in the future as the practice becomes more widespread.