Faulty rotary knob on AEG microwave
I would wager even odds the problem is temperature related. I've no idea about this model, but these sort of devices no longer use mechanical contacts. The knob is typically connected to a reluctor wheel and a pair of sensors detect the notches in the wheel going past to increment or decrement the timer. There's different types of sensors, one type uses a coil of superfine wire. The wire can develop a break, but as long as the temperature is right, contact is made and it still works. A change in temperature starts to open the break and it works intermittently. More change and it stops working.

These sensors are not repairable, they could conceivably be replaced, though I'd be surprised if you are able to get spare parts for this machine. Furthermore, if you happen to reassemble the shielding incorrectly, you could create a very dangerous condition where the device emits high levels of radiation completely undetectable to you and your family.

Even though you may be quite mechanically adept, between the radiation risk and the probably unavailability of parts, I suggest you simply find a replacement unit before this thing fails completely.