The Ranger 2.3l DOHC Duratec engine didn't use an ECT(engine coolant temp) sensor, it uses a CHT(cylinder head Temp) sensor.
This is what tells the computer the engine temp, computer then sets the dash gauge for that temp.
I would check its connection and possibly replace that sensor.
Have a look here for where it is: Ford ranger Ford: Where is the coolant temperature sensor located
Losing the AC would happen if computer thought engine was overheating or didn't know the temp