There are two earth wiring arrays in most 4e/5e looms. One is for power grounds which supplies to things the ecu switches (injectors, idle ups etc) and is common to chassis ground, its the E1 pin on the ecu from memory. There is also a sensor earth array that runs to the map sensor, water temp sensor, IAT, knock sensor shield, TPS, and narrow band sensor shield, from memory its in E21 on the ecu. The sensor earth array doesn't connect to the chassis ground and the two should be kept seperate. The ecu supplies the earth to the sensors and filters out electrical noise which is why the two are not connected together.
Its very hard to work out what effect the AIT sensor has on a factory ecu as you can't plug a laptop in and see the tables, but its my theory that at higher air temps it pulls some timing out to avoid detonation, and it doesn't effect the fueling map all that much - maybe a small % trim if anything. Thats generally how an AIT sensor is utilised in an aftermarket ecu. The sensor that can make a huge difference to fuel economy is the water temp sensor so I'd be checking that first. You can dump it in a pot of water on the stove and work out that the resistance is changing as water temp increases from cold to hot, it should be relatively linear output - you may actually be able to find that data if you google it. Anyway, if the ecu thinks the engine is cold all the time then it will be dumping a metric shit ton of fuel and there goes your mileage.
Often with these sort of things its a combination of a couple of different faults that all compound to causing a significant change in tune, and often the ecu just thinks the engine is at idle/cold for example so wont throw a code. So id check that water temp sensor for starters and its wiring back to the ecu - although if there was an issue with the wiring the ecu would show a code and in my experience with 4e/5e's its also causes very hard starting. Id also double check the TPS is outputting idle and WOT to the ecu. Plus check the map sensor is outputting the a variance and is plumbed right.