JJJ, you hit the nail right on the head
It's due to refraction occurring to the ship's image when it's either on or just over the horizon from the standpoint of the observer. The ship's image will variously appear and disappear as the ship moves and the conditions in the boundary layer of air just above the ocean's surface changes.