Pilot Locked Out of Cockpit While First Officer Sleeps

An aircraft operated by Transavia Airlines is parked at the gate at Schipol Airport in Amsterdam in 2012. Photograph by FlyerTalk member HangukStyle. Click on the photograph for a trip report written by HangukStyle.

An investigation was launched into an incident which occurred this past September where a pilot was supposedly locked out of the cockpit during a lavatory break while the first officer was asleep inside the cockpit on a Boeing 737 aircraft operated by Transavia Airlines during a flight from Greece to the Netherlands.
The pilot reportedly attempted to contact the sleeping co-pilot via the intercom without success before he finally was able to open the door and enter the cockpit — only to find the first officer asleep at the controls.
The flight presumably landed safely without any incident, injuries or fatalities — but an inquiry by the Dutch Safety Board may be launched after the investigation by the airline concludes.
It is certainly not the first time a pilot fell asleep while at the controls in the cockpit during a flight:

There is a keypad on the outside of the cockpit door for which one must have an access code to gain entry into the cockpit. Details are sketchy — but if this is the case, why did the pilot initially have problems gaining access to the cockpit after he was finished with his lavatory break? Could the first officer have intentionally locked him out? Why was there not a flight attendant in the cockpit to accompany the co-pilot while the pilot was using the lavatory? Were the pilots already tired before entering the aircraft to pilot the flight? If so, why did they not report their conditions to their superiors?
This incident does not make much sense to me — but then again, what do I know? Can you think of any reasons as to how such an incident could happen in the first place?