They don't do a headcount, well unless the particular airline requires it, I guess. The only time it will come up is if there is a seat assignment conflict.
As I mentioned in another response; I bet it's easy to get on the wrong plane if your gate is right next to the one that's boarding. There's usually a big crowd of people gathered around 4 gates or so. I've watched the gate agents and they often don't look at the scanner when they scan the boarding pass.
Oh and.. I don't know who my next door neighbor is either.
Probably not related to this, but codeshares can be confusing! Imagine having a ticket for KLM and then you get to your gate to see a Delta plane sitting out there.
Why would they even need security at Narita? If the passenger was in the international terminal then he would've had a passport. I believe, you can enter and stay in Japan for up to 90 days without additional visas.
I'm guessing his correct gate was close to the one he went through. Sometimes adjacent gates can be confusing , especially if you're not familiar to the airport.
Think of it as getting on the wrong bus.