I just did that 2 months ago and spent around 40 days out of thailand .. everything was super smooth no questions asked except they were making fun of my thai accent 😅
You need to have more than a month left in your last extension and a re entry permit to do so