If you predictably do that then the pilots won't speak truthfully in therapy in the first place.
The only way to get the lesser benefit of therapy is to precommit to not report suicidal thoughts.
The greater benefit of "pilots honestly report their suicidal thoughts and then they are stopped from flying" is simply impossible to achieve, and if you foolishly try to get it anyway then you won't even get the lesser benefit.
You're not wrong. But for this to work, the therapists' notes must be forever sealed regardless of circumstance. The first time a pilot darts their plane into a mountainside, and the investigation reveals that they told their therapist about their suicidal thoughts, this precommitment policy will vanish. The therapist will be blamed for 174 deaths. The FAA will apologize for allowing pilots who express ideation to keep flying. Etc.
It's similar to telling your doctor about illicit drug use. Don't do it unless you really trust your doctor to (a) not take adverse implications from the disclosure and (b) not write it down anywhere. Chances of both (a) and (b) are tiny. So, just lie about illegal drugs when asked. Do your own work on making sure to avoid interactions between prescribed drugs and recreational ones.
Aren't therapists supposed to make an exception to the doctor/patient confidentiality when the patient is taking about wanting to kill himself and take a plane full of people with him?
The only way to get the lesser benefit of therapy is to precommit to not report suicidal thoughts.
The greater benefit of "pilots honestly report their suicidal thoughts and then they are stopped from flying" is simply impossible to achieve, and if you foolishly try to get it anyway then you won't even get the lesser benefit.