ESD protection should be placed near a device to be protected and share a low impedance path (usually ground) with that device.
In your example, ribbon cable has inductance, so main controller and keypad PCB does not share a common, low impedance ground. In the event of ESD on the keypad panel, all the potentials - signal lines, supply and "ground" will experience a voltage transient (relative to controller ground). So you clamped the ESD to "ground", but that "ground" itself might have shifted by 100V, thus rendering it not very effective from a controllers perspective. Better than nothing, but not optimal. ESD strikes are very fast events, nanosecond time scale. Even relatively low inductances present quite high impedance.
It's a perhaps a little similar to placing bypass capacitors. We have been told to place capacitors near supply pins of components. And the reason is that we need to minimize loop inductance. Bypass capacitor purpose is to present low impedance voltage supply point referenced to device ground. In case of fast current transients parasitic inductance must be low, otherwise it presents impedance which renders capacitors ineffective. I have seen people placing bypass capacitors like 5cm away from digital IC. In that case they could just remove it, it pretty much does nothing.