I would buzz out the cable from the sensor to the gauge cluster with a Volt-ohm meter, to make sure all the wires connect thru.
If you dont have the wiring diagram the yamaha service manual for your bike is easy to find online in pdf format as a free download. The wiring diagram is near the back of the manual, and will tell you which wires to check from end to end.
could just be a corroded pin on one of the connectors.
and dont forget to check the ground wire (usually black) in the cable.
EDIT:now that I think about it, if you can see the wires on both ends, just check each color wire end to end.
Last edited by KCW; 12-22-2018 at 06:29 PM.