Gauges

So I took out the painless wiring harness and put the factory one back in now everything works except for the gas gauge it works one time outta twenty tries and when it's not working it still reads either full or empty at all times