Optical switches are always shining a beam of light and being read by the receiver, with nothing blocking the beam the game reads the switch as closed. When something is blocking the light, like a ball in the cannon, the switch goes open to the game as the receiver is not reading the light from the transmitter. When the switch is opened, the game is interpreting that as a ball in the cannon.
When you are disconnecting the switch (disconnecting the entire loom), there is no beam of light being read so the game reads that as the switch is open, or, in this case, a ball is in the cannon.
Unplugging that switch is like perma sticking a ball in the cannon so it keeps swinging to try and eject it.
Quoted from SoCalPinballs:If the loom was bad why would the cannon start turning the second I turn the machine on even with the entire loom disconnected even when I put it in test mode.