I assumed the water level switch was defective and replaced it. It did not solve the problem.
Upon further investigation turned off the hot and cold water supply independently to stop the flowing water. Discovered that the hot water inlet valve was malfunctioning. Replacing the water level switch and the water inlet valve were both quite easy.