I applied for a visa and crossed borders enough times to remember this: visas can be refused and revoked for any reason at all. And a border guard is within rights to deny you entry for any reason whatsoever.
Understanding these things made my life much easier.