This is quite a sad state of affairs and tbh, the legal system around immigration is a bit weird at the best of times. The Gov.uk site has been updated to make information easier to find and digest. So a lot of data has sadly gone. After all, where would you have expected to find the exact legislation? Plus, even if you found it on legislation.gov.uk, UK legislation isn’t the easiest thing in the world to digest.
On another note, it’s also the reason I personally refuse to go to the US. Several family members have been to the US, on holiday mostly, and each and every time they’re stopped and detained pretty much as you were (though they end up being granted entry). As yet, no cavity searches, but they end up working the delay and indignity into the schedule. It shortens holidays by a day, so they can spend some of it in the detention suite at JFK, even if only connecting to go to Canada (yes, that’s happened before). It’s one of the perils of having a brown face, UK passport and a surname like ours.
As an aside, your experience provides a more pertinent story now more than ever. The U.K. Is in the grips of “Brexit Fever” which you may be aware is a referendum put to the people of the U.K. who, on June 23rd will decide on whether or not to terminate their membership of the European Union. The facts are all in the ‘remain [in the EU]’ camp, but the irrational and somewhat xenophobic undertones litter the debate on the Leave side and people are buying it! So perhaps the UK is more racist than we’d like to believe :(
One of the crucial remaining issues is the role of border control in immigration. Many people in the leave camp are constantly telling us how our border control lets everyone and anyone in. It is plainly not true. Indeed, the U.K. Is not a practising party of the Shengen agreement, which defines the free movement zone of the EU applicable once non-EU nationals enter the EU through whatever route. This means the immigration issue is genuinely a non-issue as we already can and do control our own borders, as you’ve sadly found (I certainly am not defending the officers though). However, like pretty much all of the leave campaign’s facts, they flog each and every dead horse to within an inch of their reincarnated life. I’m sure they’ll blame this on Europe, even though you’ve never had any issue entering Europe at all.