Typically, in preventing a harm we thereby make someone's life go better than it otherwise would have. In such cases, preventing harm is beneficial, and that's why it is usually a good thing to do. But there is another way to prevent harms: you can prevent the subject who would have been harmed from ever actually existing. There's nothing particularly good about that.
My Pinocchio world can again help clarify our understanding of these issues. If someone damages a wooden statue, is it later wrong for the Priestess to bring that statue to life? (Assume the damage is moderate enough that the resulting life would still be well worth living.) Presumably not. It does mean that the earlier act of damage caused harm to the resulting person. And failing to bring Pinocchio to life would have been one way to prevent this harm. But it would not have been an especially good* way to prevent the harm. There is no real benefit to it.
* = If there is the option to bring a different, "healthier" statue to life instead, then that might be a better choice, even though no individual is made better off than they otherwise would've been. It would be a case of "goodness without benefit" (if 'benefits' are understood to accrue only to individuals). But these complications can safely be set aside for now.
So, there you have it. Although preventing harms is typically beneficial, this need not always be the case. There is also the rare possibility of preventing a harm by precluding the existence of he who would be harmed. The praiseworthiness of the beneficial kind of harm prevention need not carry over to the atypical, non-beneficial kind. (I'd say the latter is morally neutral, at least when considered in isolation.)