2002 TJ 4.0L intermittent overheating

Something similar happened to me today. I was doing some highway driving for a little over an hour. Everything had been fine up until then and then I heard a beep and my coolant temperature meter was in the red. I immediately pulled over and checked things out. Coolant level was fine. Belt seemed fine. I started the engine with the hood up and the fan was running. I waited a few minutes and started it back up and the coolant temperature went right back to where it is supposed to be.

I was going 70 so I think that rules out the fan not turning since it isn't necessary at that speed. I can't imagine the pump would suddenly stop working and then start working again so I don't think it was that. A stuck closed thermostat might do it but it seems odd that it would get unstuck as suddenly as it got stuck. It could be a bad temperature sensor or connection that made it go momentarily high. I replaced the thermostat with a new OEM (Stant) one back in January when I completely flushed out the entire system. I bought a new sensor back then but haven't installed it. I'm hoping it is the sensor. Not sure if I want to install the new one yet or wait to see if it happens again. This one has me stumped.