Temp fluctuating

I had a car once with an electric sensor that ran in the hot zone. I changed the thermostat then the sender and later I changed the head gasket and it still ran hot. I was talking to a mechanic friend of mine and he said how do you know that it’s hot? I then added a mechanical gauge to the car and the car never ran hot but the sto gauge said otherwise.