Sounds like an internal fault in the gauge. If it's a Chinese bike it's not uncommon. Gauges are subjected to considerable vibration and a lot of them are not very well made. An electronics expert should be able to examine the internal printed circuit for dry solder joints and dislodged components.
The input signal comes either from the pulser coil or the exciter coil connections in the CDI.