I'm a Canadian citizen and get this type of treatment all the time. Every time I enter the US, which is about once a month or so, they send me to a back room for secondary screening. The reason? Their system thinks I overstayed my visa once back in 1995. What actually happened was my family took a road trip to New England, and nobody bothered to check our passports on the way out, so there was no departure record. So…
One time a guy said "I don't have time for this" and sent me to secondary. After waiting about an hour I saw the secondary inspector and he told me the front line guys would send anyone back that they couldn't process in a couple of minutes and to expect it to happen again in the future.