I’ve also received this treatment entering the United States.
The thing though, I’m a citizen of the United States. I was in Canada for a day and a half for work, trucking actually, in 2003. I was detained at the border crossing into Detroit, MI. Held there for give or take eight hours, interrogated, searched, my truck was searched and also x-rayed. Yes, they have a giant x-ray machine that will do a whole tractor-trailer.
Since then I have never gone across the border for business. Several years later I took a flight to visit some family within the US, never crossed a border. I was detained and searched, and asked why I was flying but not properly questioned. Once again, a US citizen with no criminal record. Not even a standing traffic ticket, and not crossing an international border.
Nearly ten years later I flew again, and wasn’t bothered. My only guess is that my name was removed from whatever list it was on. Or possibly because I’ve obtained some transportation credentials through Homeland Security (TWIC ID) I’m a known quantity. I’m not really sure, to be dreadfully honest, but I’m not sure if I’m terribly interested in another road trip to Canada. I may have to though, I have dreams about seeing Alaska that may not accept complications for an answer.