At high rotation locations like EDI, GLA, AMS then the risk is someone with similar names being given the same boarding pass for the flight and one passenger not really reading their boarding pass correctly. The first passenger went through the gate, perhaps the wrong one first. Then the correct passenger. the gate bleeps to say already boarded, agent double checks the passport and thinks "oh I must have scanned him twice" or similar, let's the passenger on. Even more likely if they are in an exit row seat since there is a bleep for that too, so the agent starts to discount / lose track of the flow.
What makes it harder to spot is if there are a few spare seats, the second passenger doesn't make a fuss and takes an empty seat rather than getting the cabin crew on the act. If that happens then it can be very hard to work out this has happened.
It happens, but with attention to detail it can be avoided.