Oven door won't close...then it does..then it doesn't

The light in the oven started staying on. I replaced the door hinges, hinge receptacles, and door gasket. Additionally I leveled the unit and tightened all the screws in the oven liner then ran a self clean cycle to seat the gasket. The door closed normally and the light went out…until we roasted broccoli at 500 degrees for 20 minutes. After dinner I removed the oven door and then reseated it. Now the light is out. What am I missing?