For those of you that have been voluntarily or involuntarily admitted as a patient to a psychiatric ward for a number of weeks, did you inform your workplace of this? Did you tell them exactly what happened or come up with some big lie e.g admitted to a regular hospital for physical problems?
I don't know what country you're in, but I think in most western countries it would be difficult for them to get rid of you based on being admitted to a psychiatric ward, unless you work with vulnerable people, or could no longer carry out your job afterwards.
I appreciate that this may not be your only concern, and that you may be worried it might affect their opinion of you - and I can't say whether or not that will happen, as is the stigma around mental health.
I would encourage you to at the very least seek psychiatric help if you're at the point where you are going to CTB otherwise though, if you think that psychiatric help might actually be of benefit to you. If you're going to CTB anyway, who cares if you lose your job!?