I had those symptoms a few years ago on mine, together with loss of cruise control and loss of air conditioning. Turning off the engine for half an hour restored normal operation. The problem was caused by a defective battery, so fitting a new battery solved all the problems entirely.
I am not saying that is definitely what is wrong with yours, but it has become apparent to me since then that defective batteries can cause all sorts of strange electronic faults that do not show up on code readers, a fact confirmed by the mechanic who rectified mine. What makes it harder to diagnose is that a simple voltage test of the battery will not show anything untoward; it needs a deep discharge test, which most owners do not have the equipment for, to reveal the fault.
If you can not find any other fault and if your battery is more than four years old I suggest you get a new one, not a secondhand one. It will have to be coded to the car by the installer.