I experienced similar treatment to what was mentioned in the OP this summer at Heathrow. That was the topic of a now closed thread, but British immigration seems to have particular issues with young people, especially who are traveling alone. While the person I dealt with was evaluating my right to entry to the UK, I was actually changing planes at Heathrow on my way to Dublin and encountered an immigration check entering Terminal 1 and told him I wasn't trying to go to the UK.
Some direct excerpts from our conversation, during which I remained totally calm:
me: "Don't I still have to go through a passport control in Dublin?"
person: "Yes, but they may send you back to the states." (not substantiated with any explanation thereafter)
later
person (this was the last thing he said, rather sneerlingly): "For someone who studies international politics, you are REMARKABLY disorganized, Ill give you one month."
(quietly thinking to myself then): "Great, I got permission to enter a country Im not and would rather not anytime soon visit...hooray!!"