Microwave - no heat unless I open door and then close it

I have a Whirlpool Gold (model GMH6185XQ-1) and it won’t heat unless I trick it into working. I have to enter in the cook time and press start and let it start running (runs, but gives no heat and cannot hear any magnatron load), open the door, then close the door and press start again. It will then begin heating and I can hear the load of the magnatron kicking in.

I wonder if the first time it starts cooking, the capacitor has no charge to begin with so it won’t heat, but when I open and close the door and press start again, the capacitor was charged from the first round so it can begin working as normal.

I tested both door switches with a multimeter and they seem fine.

Another way I can get it to work is to put in my cook time, press start and let it begin running, lower the temp and then raise it back up. I can then hear the microwave "kick in" as the load of the magnatron begins working.

I was going to just replace the capacitor and diode but wasn’t sure if they were the problem. The capacitor is only $20, but the little diode is $46!