I had something slightly similar. I got an "Err" message, and would have to switch the camera off and on again to get it back.
Then the shutter failed.
This was replaced under warranty, and at the same time Nikon loaded the latest firmware, and since then the problem has not occurred again.
I assume the problem in this case was firmware rather than shutter related, and thus ask whether your camera has the latest firmware.