It's not a rule. But a lot of people are being warned they are coming too much as a tourist and they will not be allowed back again without a long-term visa.
That's not true. There are agents you can purchase "safe entry" from that will vet your information with immigration officers at the airport, who will then meet you when you get off the plane and walk you to the immigration counters, open a counter just for you, and stamp you in. Guaranteed entry starting at 2000 baht and going up to about 8000 baht depending on your history.
get the non-O in the US. You won't be able to get it in Thailand without a Thai bank account and you can't open a Thai bank account without a non-immigrant visa. So you have to get the visa from the embassy
People being denied entry are not flying all the way to Asia. They are leaving Thailand to a neighboring country and coming right back, and trying to stay here long-term without a long-term visa.
As you saw, they did not stamp you in for 45 days as that's not legally possible. But their warning is clear. I wouldn't try flying in again for quite a while without a visa.