if you reside in Thailand for more than 179 days in one year in Thailand, you are a Thai tax resident, regardless of your tax status in other countries.
In 2024, you collected capital gains in the US and remitted some or all of those earnings to Thailand. That was a taxable event - even though your initial investment was made years ago.
You are misinformed. The point of the US-Thai DTA is to give US citizens living in Thailand a tax credit (taxes already paid in the US,), not to absolve them completely from paying Thai taxes.
For example Long Term Capital gains are taxed at 15% in the US, but are taxed as ordinary income in Thailand. But this is all getting into the weeds, when the bottom line is you're not going to file a Thai tax return.