I don't profess to be an expert but, I had some similar issues with my VN wagon. Sometimes the gauge would work, other times it would be working then not, then back working. It had me puzzled for a while because before this, it was always working as it should.
In desperation I jacked up rear and put it on stands and slid underneath with my work light to check the wiring connection at the sender. The connection looked alright, but I pulled the connector plug off the sender unit and then pushed it back on.
To my surprise, the dash gauge again worked when I turned the ignition on. My conclusion: the terminals in the connector plug and sender unit had just become dirty over time, resulting in poor conductivity, which changes the resistance required to make the gauge work properly.
This may not be the answer to your problem, but you could try just pulling the connector off and pushing back on a couple of times to clean the contact.
Cheers, Jet.:beer chug: