James Gray, a KLM Royal Dutch Airlines passenger, made a nearly tragic mistake on his flight from Edinburgh to Amsterdam.

At 30,000 feet, Gray mistook an airplane door for a restroom. He was detained overnight, fined ₵2,497.02 (600 euros ) and banned from the airline for five years, The Telegraph reported Sunday.

"The crew told me to stay in my seat and I was to be arrested when the plane landed," he told the newspaper. "I tried to explain it was a simple mistake. It was a misunderstanding. The police came and arrested me. They weren't too friendly."

The newspaper didn't say when the incident took place.

"After the flight the passenger was handed over to the Royal Police at Schiphol because of his misbehavior on board. We do not give any details on individual passengers," a KLM spokesman later told CNBC in an email.