If its playing up like this then it could actually be the wiring in the door loom. As this is a Whirlpool buit dishwasher and this is very common on them as were the wires bend at the bottom of the door they can break and causes this kind of fault were it plays up when you close the door and go off.
What you need to do is remove the outer wooden door panel.
Then from there remove the outer metal door panel.
Then make sure its unplugged.
There you will see the wires running do the door. Open the plastic holder and you need to inspect the wires there. Give each one a tug and see if any are broken. Check the blue ones first as its usually them that break. If any have broken then you need to repair the wires and then see how it goes from there.
But if the wires are fine in the door loom then it will be the control board at the top of the door at fault here. In this case the board will need to be replaced.
But check the door wiring first as i think you may find this could be the problem here.
Just wondering how you got on with the appliance as ive not heard back from you and the question is still open.
Do you still need help on this? If so then just get back to me. But if not then if you could rate the question then that will close it.