Imm. officers are only enforcing the law, not arguing the applications and definitions. If they arrest you - it doesn't matter on what reason, but they must come up with such document within 24 hours (maybe not that, don't care).
You can only challenge your detention in the court, not in the garden on car wash. And yes, you can always sue back. In any case I kindly tell any smart a** to go whistle.
Why is this childish paranoia? Esp that recent story about two silly shmucks at Koh Phangan.