Dishwasher starts as usual, then begins to fill for about 5 seconds, then stops filling.
If left alone, it begins to try to wash as though it has water in it.
I suspect the timer, the older mechanical type.
More than likely the winding in the fill valve solenoid is separating from the terminal inside the housing when the valve is hot . You can verify this by pulling back the fill solenoid terminal connectors just a bit (about 1/8" or so) … just enough so you can touch the terminals with your multimeter .
Start the fill cycle and wait till the water stops . Immediately put one meter probe on each terminal . If you get a 120 volt reading , the valve is no good and needs replacing … and id there`s little or no voltage , either the float switch or timer is no good .
With the mechanical timers , this problem is almost always in the water inlet valve itself .