Image copyright Getty Images Image caption Chrissy Teigen live-tweeted to 9.2m followers when the flight she and John Legend were on was diverted

On 26 December a Tokyo-bound flight from Los Angeles was turned around mid-air after it was discovered that an "unauthorised passenger" had managed to get on board without a valid ticket.

More than 200 passengers, including celebrity couple John Legend and Chrissy Teigen, were on the "flight to nowhere" after taking off and landing at the same airport eight hours later.

But in an era of strict airport security, social media was abuzz with one question: How did someone without a ticket get on the flight?

What about airport security?

A government official confirmed to the BBC that the mystery passenger had passed airport security checks and had a valid boarding pass - just not for that particular flight. The FBI say they are now investigating how it happened, but they have not charged anyone with anything.

According to US media, the confusion happened when two brothers who were bound for Tokyo got on the same flight, despite booking with different airlines.

The airlines, Air Nippon Airways (ANA) and United, have a code-share agreement in place and reportedly both had flights leaving for Tokyo at a similar time from LAX, which could begin to explain the mix-up.

A passenger on board the flight told the BBC that the mistake was only discovered when an extra meal was handed out by staff in one of the cabins.

Image copyright Getty/AFP

'Beedoop machines'

Model and television host Teigen live-tweeted the drama of her and her husband's delay to more than nine million followers on social media.

"So basically the boarding pass scanner is just a beedoop machine that makes beedoop noises that register to nowhere," she posted, after passengers were told about the confusion.

Aviation security expert Jeff Price explained to the BBC that boarding pass scanners typically tell airline staff a passenger's seat assignment at the gates as they board.

If they are seated in an exit row seat, they may then check if they are OK to operate the emergency door. He said if there's a problem with the ticket or the QR code can't be read, staff should be alerted.

"It could have been a technological problem or a glitch in the software," he said.

"It's unusual - it could be a weird series of perfectly timed accidents or a complete and genuine mistake."

Does it happen a lot?

It's not common, but it has definitely happened before. Mr Price points out that hundreds of millions travel through the country every year, and at US airports your identity may not be verified again at the gate after the initial security check.

Image copyright Getty Images Image caption US airport security is operated by the Transportation Security Administration (TSA)

Earlier this year a French woman, Lucie Bahetoukilae, reportedly ended up in San Francisco instead of Paris after getting on the wrong flight from Newark airport.

Her niece told local media Ms Bahetoukilae could not speak English and had therefore not understood an earlier announcement that her gate had changed. She said she had found someone in what she thought was her reserved seat on board the incorrect flight, and was just told by staff to find an alternative.

Aviation blogger Jason Rabinowitz told the BBC that it happened to him when travelling to Germany. Remarkably and coincidentally, two passengers with the exact same name were bound for the same country, on two different flights to different cities. He said staff only realised before take-off after finding an extra person on the headcount.

"For this to have happened, there had to be numerous points of failure," he said.

"And more than likely this comes down to a series of human errors."

Why did the Tokyo flight turn back?

ANA said in a statement that when the cabin crew realised one of the passengers had boarded the wrong flight, the pilot in command made the decision to return to Los Angeles.

But security expert Mr Price said it was "very unusual" for a plane to divert back with this sort of issue.

"I've been on a flight before when during taxiing someone realised they were on the wrong flight, and were told they would have to carry on to the destination," he told the BBC.

He said the diversion costs would run into the hundreds of thousands of dollars after air fuel, customer compensation, crew diversions and disruption to onward travel were taken into account.

Flight attendants had "timed out" of legal duty hours by the time they got back to Los Angeles, so another crew had to be found for the re-arranged flight that departed early the next day.

"There are three main reasons a captain will divert or turn around: safety, security or health reasons," he said.

After the lengthy diversion Teigen asked her Twitter followers: "Why did we all get punished for this one person's mistake? Why not just land in Tokyo and send the other person back?"

But as Mr Price pointed out, US federal authorities make clear that in situations of doubt "ultimately the captain has final say".

The airline has since said it supported the pilot's decision "out of the abundance of caution and safety for the passengers and crew".