@Anthony ******
There is either a miscommunication with the agent, or they have no idea what they are talking about.
You can enter Thailand only 2 times per year at at LAND BORDER without a visa. The limit is doing visa exempt entry 2 times per year by land. This rule has nothing to do with applying for extensions, and it has nothing to do with arriving by air.
That being said, just because there is no law about how many times you can enter Thailand without a visa by air, your entry to Thailand is at the discretion of the immigration officer. They've determined you are spending too long in Thailand without the the proper long term visa and made that clear to you. But they let you into Thailand. After that everything is normal. You can take your 30 days, and you can apply for an extension without issue.
If you try to fly back to Thailand again without a proper visa you're very likely to be denied entry.