If you've unplugged the sensor , that is all well and good for now, all you need to do now is work out whether or not it was to hot in the engine at the time it was still running.
These cars run an anti percolation feature if the coolant reaches near 105 degrees (somebody quote me if I'm wrong).
Another theory is , if the sensor was open circuit , the fan would run only when ignition on or engine running.
Therefore it would stop when ignition was off , as it is now as you've left it.
But yours was running with the car switched off , so my theory is the sensor was giving the wrong temp to the ECU or it was just too bloody hot.