Hi,
Sounds like the timer (part #WP21001522) may be the problem. Either a worn contact operating cam or a faulty (dirty?) contact.
Unfortunately, they cannot be repaired, they have to be replaced. Search online using the ''part number only'' to find suppliers that suit you
''Do not'' attempt to open the timer to fix it as you will have cams and contacts going everywhere once the case is opened.
You could try disconnecting the power from the machine and then accessing the timer and liberally spraying some [https://wd40.com.au/product/fast-drying-contact-cleaner|contact cleaner] (example only - there are others), in through any openings in the timer case, allowing it to fully dry (read directions on can) and then check if it now works OK. Do not use "regular" WD-40 as this leaves residues which may cause problems.