I had this happen on a KitchenAide which did it a lot but not 100% of the
time. Even had a serviceman out who replaced the entire
(electromechanical) timer but it would still do it.
On this machine, unlike, say, a washing machine where everything stops
until the water reaches whatever the desired level is, as long as it takes,
the water fill was simply based on the timer turning the valve on for a
certain number of seconds. I presume there are dishwashers that do
actually sense water level but this one doesn't.
The little float switch only was there to prevent the water from getting
too high (it interrupts current to the fill valve). The timer doesn't halt
and wait for the float to lift or anything like that. You just get so many
seconds of fill valve "on" time and that was that.
I was finally able to catch it acting up and saw that power was going to
the fill valve but water wasn't going in so obviously the valve itself was
the culprit. I pulled the wires from the valve's solenoid coil and found
it open (dead). Turned out that the valve had a thermal fault--after so
many seconds of power on the solenoid would get hot and become electrically
open--turning off the water flow. When it cooled down it would act normal
so it was hard to find.
Fortunately I had saved the fill valve off an older KitchenAide that had
been replaced after 10 years of service when the main seal failed and water
had damaged the motor. The old valve was a little different so after
mounting it and hooking up the hot water copper line I had to get a length
of hose to connect it to the water fill / vacuum break thing on the side of
the machine as the orginal tube was a bit too short to agree with the new
(old) valve. That was a number of years ago and it's been fine ever since.