You can leave whenever you want sub 180 days and it resets when you come back. Ive done multiple few weeks/short months, left, came back and it always resets.
You urgently had to go back.. on a tourist entrance.. and you could not have just picked another country that has the same 45-90 day exemption for tourism?
The ask:thailand community, consisting of multiple Q/A groups with over 100,000 members, powers this platform. It is not an official government resource. Our members actively contribute to this resource, and while we strive for accuracy, we cannot guarantee its complete reliability. Assistance to travelers is provided as a community service.