My hypothetical is that two guilty people acted exactly equally, that the justice system has perfect knowledge of this (stipulated that this is usually unrealistic), and that the difference in outcomes (actual harm vs no harm) is purely attributable to chance. Unless you’re fighting this hypothetical, then I see nothing simple here. However you “address actual damage” (monetary restitution, jail sentence for deterrence, whatever), you have made no argument as to why it is not more just for both guilty people to face equal consequences.
Take your example of negligently failing to clean your icy sidewalk. You could fine everyone who acts equally negligently the same amount, with the money going to a consolidated fund that pays out to anyone who is actually harmed.
You face the same problem under any approach to justice.
Here you have simply stated an extreme example of the status quo. I am disputing that it is just. Are you suggesting that drawing an analogy to the lottery paints the current system in a favorable light? I don’t see how. Does the actual winner of a lottery deserve their winnings more than another losing player?
This fights my hypothetical. The difference in outcomes here is attributable to different actions by the guilty party, not to chance.