The Pi inputs are much higher impedance than the LED's, so more sensitive to noise and that's why I put the cap there. Although your debounce algorithm should filter it as well.
I use the
debounce integrator approach, as well as a blip counter to track noisy inputs. I can tell which sensor is noisy but will not trip until the debounce period.
It did fail me once, a thief was hammering the door and the door switch was going on and off and did not trip the alarm. It would only trip after being open for about 0.8 second, which does not happen with a hammer and body slam. So I turfed the shift-register debounce algorithm (crap), rolled back the time... and he came back for Round #2 and it tripped like it should. I debounce relatively long, which commercial panels do, to filter out cell-phone and lightning impulses etc.
Did you measure the opto-coupler's voltages with the alarm on/off? Just to make sure the LED is actually turning on/off properly. I can't see this H/W being the problem, unless the grounding with RPi power supply is clashing with the alarm panel's power supply.
It can also be the alarm panel making a blip once in a while, don't assume they are glitch free.