it seems plain to me that the plunger that makes contact with the gps gear position switch is losing contact. when code is set (because it cannot read a correct gear it fail safes and more than likely retards timing) bike runs for $hit.
now i think that u mention that u had this taken care of but i still think the plunger is the problem.
of coarse u can counter this prob by putting up the kickstand up starting it and letting it warm up.