In a case like above it is common practice to hand in yr p.port once you have been stamped out. Or you can stay airside without hotel.
Of course Thailand could re-enter everybody by cancelling exit stamp but then you spend even more time hanging around before you get to a hotel.
Yes, I went through such a situation in Kuwait.