I always plan on having my docs at least cursorily checked at the gate during boarding for any international flight. That is to assure that the individual boarding has the documents with him. There are innocent, e.g., people lose their passport and not so innocent problems. None matter, if a pax arrives at the international destination without proper docs., it is the carrier which is fined and tasked with returning the pax to the point of origin.
If you wound up in secondary on one occasion and were accused of "bad attitude" on another, you might consider just dealing with these things in a neutral manner. The line agents with whom you interface are not policy makers and are not going to change. If you want to kvetch to AC, border authorities or whomever, that is fine. But, in the moment, simply produce what you are asked to produce and leave it alone.
For a later secondary to have been caused by your conduct, it would have had to have been recorded by AC and forwarded to Canadian and/or US authorities. That's a lot of work.