Quoted from Durzel:
There are two things here. Firstly, it has to learn when to flip, and initially it does this by a process of trial and error. Once it has calibrated itself if the machine is moved to a different location, or the levelling changed, or maybe even if it is cleaned or waxed, then it will become unreliable because the conditions have changed.
The game also uses the target switches around the swamp to detect if the flip was early or late, so if any of those switches are bad then it will have a hard time learning the Swamp shot.