Certain invasive cancer treatments can look a lot more effective than they really are, if all cause mortality isn't measured. It's possible to reduce the risk of a patient dying from the particular cancer they have while also lowering their overall life expectancy, since the procedure itself can be extremely harmful.
I have a slide in a lecture somewhere noting that no one would ever die of a healthcare-associated infection if, when admitted to the hospital, they were put in a room full of ozone or hydrogen peroxide fog and intense UV light, while never being seen by a nurse or doctor.
Indeed. That's the point of the example. "You will almost certainly die in this room, but you won't die of an infection. So if we just look at infection-related mortality, everything is fine."