ge oven turns off by itself

oven heats up but sometines turns off by itself, display reads door locked, repowered , opened the control panel and let the oven run for 2 hours and it stayed on, noticed on the wiring diagram that the fan should be running in any mode of operation, its not working. checked thermal fan switch with oven at 350 and its open, jumped it out and fan works, is the fan used to cool the relay board/ clock? could that make it turn off thanks