That is incredibly bad luck - you must have missed it by a whisker.
I've noticed similar things happening many times. Maybe the 'Circle of Contact' (or whatever you want to call it) around the designated center of the flag isn't a true circle, but faceted - so it depends upon the angle your wheel sweeps past ( and it's own CoC would be the same), as to whether you get a contact or not. Also, often the center of the flag doesn't seem to be the center of the 'target'. The physics engine is pretty old and probably not very high resolution. Not having designed a level I don't know, just guessing.