That isn’t true. There is no 5 times rule. There is no rule. It’s up to the immigration officer to decide. It could be your second time trying visa exempt or your tenth time.
Oh man. There’s so much wrong with your story. Royal Thai Embassy’s issue visas to allow you to enter Thailand but with the caveat that it’s at the discretion of the Royal Thai Police (Immigration Division).
One is not the “boss” of the other.
Having a visa does not guarantee entry in to Thailand. What it does is allow you to stay for X number of days IF immigration grant you permission to enter.
You mentioned something about a visa extension. That expired the second you left Thailand unless you had some re-entry permit off the back of it but as you were entering visa exempt that’s a moot point.