I take your point. On two occasions that I remember I have insisted on offloading drunks. The company agent did not agree with my action because he did not want a fuss, or did not want a delay.
However, as you say, with sufficient cause the Captain may deny travel to a pax. No one is disputing that the offload was justified.
BUT...if it was a case of the company being 'ok with it' then who would press charges? Presumably the security mob or the Feds, even though she passed security and was found to have no device.