The headline doesn't apply to the first example. That scientist was intentionally infecting himself with the disease and the desired outcome was dying to prove his hypothesis. Death wasn't just a risk. Death was the only goal of the experiment.
People who inject vaccines do it with the expectation of surviving it. The goal is to avoid death.