Term for the tendency to relate events that occurred in proximity? What is the correct scientific term for the tendency to wrongfully relate arbitrary observations to a significant event, just because they occurred in temporal or spatial proximity?
Most recently I have observed this error in a discussion about an unsolved killing, where a participant was quite sure that her observation of a black van in a far away town was related to the killing, for the single reason that it occurred around the same time.
This is informally referred to as the illusion of causality:

Illusions of causality occur when people develop the belief that there
is a causal connection between two events that are actually unrelated.
Such illusions have been proposed to underlie pseudoscience and
superstitious thinking, sometimes leading to disastrous consequences
in relation to critical life areas, such as health, finances, and
wellbeing.

This is a cognitive error in the way humans infer cause and effect.
The example that I'm most familiar with is in medical quackery.  Suppose someone is experiencing constipation.  They try some advice from friends: Go for a long walk, eat some prunes, massage their stomach, use magnesium supplements.  Then they try more questionable solutions: Probiotics, colon hydrotherapy, acupuncture, herbal medicines.  At some point during the process, the constipation is relieved, and the patient naturally concludes that whatever treatment immediately preceded this event must have been the cure.  They &quot;swear by this treatment&quot; from then on, failing to consider that prior treatments may have needed more time to take effect, that other activities not considered treatments may have affected the results (eg, regular exercise, dietary changes), or simply the mere passage of time.