I'd be willing to bet that the sender isn't bad, but the wiring at the connector has dried out, become brittle, and there are now exposed conductors that are shorting together under certain conditions, such as when the engine gets hot, vibrations due to terrain, etc.
I chased this type of...