Electrical puzzle

My 96 honda accord will go dead during the night because the fan keeps going after the car is shut off and key removed. BUT sometimes it does not do this and is fine and acts normal for a few months. When it does this weird behavior, I have to disconnect the battery cable for the night.

My Chrysler did this and it was a bad fan control module. Find out if your car has one of these.