Analogies are seldom perfect but they are often useful. They help to illustrate a point. The world is not a programming language and most things can’t be ascertained by mathematical proofs.
But all that is irrelevant because what I posted above wasn’t an analogy. It was… A thought experiment? A purposefully exaggerated example? Anyway, not an analogy. Analogies compare two different things via a third thing they have in common, but here I used examples which are directly related to the subject matter. The point was to make it clear, via extreme but realistic examples, that correlation does not imply causation.