Groucho: "I don't think it has still been clearly established exactly what happened on the JetBlue flight where the nominated Captain was 'locked out' by the F/O."
I found the FBI report, which is quite interesting. OUTSTANDING response by
the FO and CC. Briefly, the captain was acting erratically, so the FO suggested they invite an off-duty captain to the cockpit. The captain abruptly went to the lavatory, but alarmed the CC by "not following protocol". It's short, you'll want to read the whole thing.
FBI ? JetBlue Pilot Charged with Interference with a Flight Crew