Don't fret too much, It's just a thought experiment with so many assumptions and some logical holes like death is not exactly a binary state.
Suicide is not the reason of this quantum immortality, it's just a convenient way to illustrate this experiment when the observer is aware that they will die in the box.