A mess (noun) is
a situation that is very complicated or difficult to deal with - MW
To mess up, then, (as a verb) means
To cause to be confused or troubled: The divorce really messed him up.
It's an idiom, like "messing with one's head" or "messing me up".
Nurses may feel bad about their sick patients, maybe worrying that they will suffer and die (conjecture; more context might be helpful.) But they can understand death in the context of illness.
It is much harder to think of death occurring so randomly to a healthy person. So, the nurse is likely expressing how troubling such an event is compared to more understandable events, like sickness and death.