There are middle-aged men who can have entirely innocent reasons for talking with a 12-year-old girl: Confirming that she’s not lost/knows the way home, noticing something amiss (shoes not tied, backpack unzipped, jacket is torn, etc.), she’s new in the neighborhood and he’s saying hi, he has a kid near her age, he has a dog that sometimes needs pet-sitting, he teaches at her school sometimes… whatever.
None of those reasons will result in him saying, “why, are you a cop?” to someone else who asks how he knows her. Instead, he’d say, “I don’t, we just met, and [reason he introduced himself].”
And he’s not likely to make her shut down and look nervous in the first place, because even when we can’t articulate why someone is creepy, we recognize creepy when we find it. Even if his reasons are not friendly - “I raise exotic flowers and I don’t want kids on my lawn!!” - it wouldn’t set off the creep-o-meter. And, again, he wouldn’t get defensive when someone else asked why he’s talking to her.
A guy who recognized her as Girl-Scout-aged and wanted to know if she’s involved in a local cookie drive, would not be dimming her normally bubbly nature.
Occasionally, autistic people will come across as creepy. This, again, is mitigated by asking him what he wants. An autistic person will not say “are you a cop?” He’d say something like, “I saw Wonder Woman on her t-shirt and I have a comic collection and wanted to know if she reads comics or if she likes the movie more.”
People who have a non-predatory reason to interact with kids will give that reason when asked. If pestered about it because the initial explanation sounds weird, they’ll double down on that reason, not jump to “why are you accusing me of wrongdoing?”
If the guy in this incident were a track star (”wanted to give her some pointers”) and he saw her jogging and wanted to correct her posture or tell her she’s got the wrong kind of shoes… he’d talk about how much he knows about running, not insist that he’s not breaking any laws.