You were lucky, but you post it here and other people may think that this is normal procedure but it is not!! The airliner can refuse you on the flight when you don’t can show that you will leave in Thailand before the end date of your visa or visa excemt period
What I read here is correct , visit the BOI LTR website, look what you need; if you have questions ask them by phone; they are very helpful and no costs for them; the only costs you have to pay is 50.000thb to immigration for 10 years