OK here's my theory.
The PCB and the mould form plates of a capacitor, the epoxy is the dielectric.
As it's liquid, the epoxy is contacting the mould extremely intimately, at the molecular level. There is also a mould-release compound, which may have some effect - I'm not a physicist or chemist but I imagine that a mould-release agent is probably using an electrostatic effect at the molecule level to repel the thing you don't want to stick.
The act of removing the now-solid piece of plastic from the mould induces a charge as electrons get ripped off at the boundary, so the PCB, which is now isolated inside the plastic, is sitting at a potentially high voltage, and due to its size, has enough capacitance to store significant energy.
Most of the time this would get discharged whne the groundplane edge, or ground wire during test gets grounded by contact,. but if the pad near the end of the PCB, which has minimal epoxy on it, or the non-ground wire touches something first, this discharges the stored charge through the IC pin.
The fact that it manages to do this via a 5K6 resistor suggests significant stored energy.
No rubbing is needed - I believe the act of peeling out of the mould is enough to create the charge.
Does this sound plausible? Any physicists here?