There is a little plastic hook that pops out to catch the cartridge tray. It must not be extending enough or be worn.
Sticking a 2nd game cartridge in is a good hack to make it work (very common, but usually used to compensate for a worn out 72-pin connector not completely making contact with the game cartridges, causing the flashing screen/powerlight) or you can open it and see if you can fix or replace the cartridge tray latch.