Haha! It happens ALL the time, try doing some research or reading peoples posts/experiences about having to book onward travel after being refused boarding. Airlines wont allow you to travel without the correct documentation!
The extention of stay is not a given and has to be applied for and, whilst rarely refused, it's only issued at the discression of the IO. The onus is on the airline to check their passengers have the correct documentation to enter the Country of destination. I dont make the rules!
You should be ok if you're studying long term in Thailand and have a multi-entry visa or a re-entry permit. If not you'll need onward travel within the lenght of your stay to board your flight.