I’ve noticed this quite a few times before when working with my systems administrator: He calls me in for a debugging session of a problem he‘s been stuck on for some time and within a few minutes (or less than a minute) he finds the solution.
I’ve always seen it as him having to reorganize his thoughts to give me a somewhat structured introduction into the problem. And somewhere along the path he finds the missing piece.
The general idea is to first try explaining your problem to the duck, which is thought to activate the same problem restructuring pathways. However, I've always found that a human makes for a much better rubber duck in practice. Something about the immediacy of the conversation helps my brain to stay on task and not get distracted partway through the explanation.