The custom code didn't take touch + touching into account when another surface was touching automation.