Another fuel gauge issue

You say it worked intermittently. A poor connection might be at that harness connector but... More common poor connection is ground jumper on fuel line at sender, or speedy nuts that attach gauges to printer circuit board.
Most basic first test, remove the wire from the sender and attach it directly to chassis ground. At switch on the needle should move to max/full . Proves all good except sender and its ground.