The fan should only be 'on' when car is running, and not turn on after you removed the key.
-If for any reason the thermostat is not working correct, you can risk that the fan will just continue to run, until no more volts on battery.
-When any car stops, the heat will always rise.. -since there is no waterflow anyway, it does not help that fan turns on (well the air is cooler, but not the engine)
Claus, what is your basis for stating the fan should never come on after vehicle shutoff?
I agree with your statements regarding heat soak (as I mentioned before underhood temperatures will peak several minutes after the vehicle is shut off). However, most OEM vehicles are calibrated such that once a certain coolent temperature is reached, when the vehicle is shutoff the fan will continue to run for a specified time. For the components we tested, in the case where we exceeded temperatures, one solution was longer fan run time. Then it was usually a matter of getting buy in from calibration for a slightly longer fan run, or in the case where it was too long, then insulation would be necessary.
Often you won't find the fan run on after shutoff with normal conditions (ambient temperature, moderate driving), but when certain temperatures are reached they use it.
Furthermore one of the techniques to "age" parts is using heat. Heat not only breaksdown composite materials, but the thermal growth rate differences between different composite and metallic materials either bonded with adhesive or fastened together can induce stresses, or in some cases relieve stresses causing a part to deform in a way not conducive to function.
Airflow over the engine will help reduce underhood temperatures. Maybe not for all components (depending where it is located) but nearly most of them. And yes it will continue to rise, but the curve is much reduced. And the less excessive heat your underhood components experience, the better.
Since I never worked in fan sensors, I can't say for sure whether they fail in the way you stated, but I had never experience this in testing, nor have I had this happen on personal cars.