I'm quite certain you're wrong about how deportation is triggered in Thailand. As far as I know, it's sufficient that Ministry of the Interior gives that order. Yes, it's that arbitrary. One can appeal e.t.c., but the process isn't handled thorough the courts, and one doesn't have to be found guilty of breaking any law.
https://www.hawryluklegal.com/2015/04/how-deportation-works-in-thailand/
We're merely guests in this country, and our rights are rather limited.