What a sorry failure of the system when a doctor can't notify a dangerous individual to the authorities. The system killed the passengers in this case.
The question is: Did he know / tulips this individual to be
dangerous? Just because the doctor writes such a note it doesn't mean he would have even remotely expected like that.
While the doctor is sworn to medical confitentially, there are exceptions by law in case of an justified emergency (as per §34 StGB). If this pilot had made any remarks indicating he's contemplating such a suicide, the doctor would have been allowed to inform the authorities.
But we don't know anything of this yet. Perhaps the doctor didn't know the full extend of the pilot's 'problems'. Maybe he did and failed to put 1+1 together.
At this point, it's just speculation.