The latch hooks on the door fit into a plastic latch and switch assembly that's located inside the oven, behind the control board. It's probably come loose from closing the door over time. To access the latch assembly, remove the oven outer wrap that covers the sides and top and look just behind the control board on the inner wall of the oven. If it looks like something is broken, it will need to be replaced. The part number is(NNN) NNN-NNNN and the price is $4.35. You can buy it at www.repairclinic.com
If my answer helps you, please click on the 'accept' button. That's how we experts are paid for our efforts.