Whirlpool won't drain on some settings

Looking for help to diagnose a Whirlpool undercounter dishwasher. The unit will not auto drain and then overflows on the floor but only on some of the settings.
When you press “CANCEL/ DRAIN” it drains fine. Thought maybe the float switch, but why would it work ok on some settings?
Please help.

Hi.

The problem you described could be caused by the defective control board

AP6013336

Or bad float switch assembly.

Check part ##11, 15, 16 on the diagram

Fill and Overfill parts for Whirlpool GU1200XTKS0 - AppliancePartsPros.com

Salmon.