I think this is identical to what I wrote above. You've reproduced the arithmetic argument precisely, and the fallacy can be named "but for" or "excess causation."
Legal theory addresses these problems because they come up in court. There's a famous case where an ambulance was driving an injured person to the hospital when it was hit by another vehicle and rendered undriveable. It wasn't like a hit-and-run or a reckless driving or anything like that -- it was just an ordinary accident. But the patient died because they didn't get to the hospital in time, and the patient's family then sued the driver for wrongful death. If the driver hadn't hit the ambulance, the patient would have survived. And the court said (and this is either a view of all states or a large majority of them) that the accident was not the cause of the patient's death. It was a "but for" cause, but not the "proximate cause" (which was whatever caused the injury in the first place).
There was also a subplot in the third season (I think, maybe second season) of The Good Place that indirectly addressed the issue. It was the discovery that nobody had been able to get into the Good Place for centuries because so many of our actions cause harm that we can't see, and thus we aren't "good." Like if you eat chocolate, you are subsidizing slave labor in Africa so you're bad.