If you're looking for a 100% assurance that, as a foreigner, if you get on the plane, you get let in the country, that's never going to happen, for security reasons. There will always be only some things that only passport control will catch.
I mean, a country's borders are the last chance to turn someone away, so it makes sense that that's where a certain level of scrutiny will apply. And the only people a country is going to trust to do that, is its own passport control workers. That's just a reality.
And as far hassling returning citizens... as an American, I would be horrified if I encounter trouble returning to the US, just tremendously pissed off.
But I can also understand that, with the US probably being the most popular country in the world to want to sneak into, people might be trying to fake their way into the US as supposed citizens, and that determining citizenship and identity at immigration might not always be as straightforward as it might. (But I still think it's horrifying to have to go through computers, phones, text-messages, etc... - I'm not defending that at tall!!)
These days we should be able to pre-clear people accurately enough that passport control at destination should be a formality.
(Also, my country for one does not hassle their own returning citizens at immigration the way the US likes to.)