If your chain was loose enough to jump off the sprocket it wouldn't have passed the MoT. This sounds more like a gearbox issue to be honest if it's stuck in gear. Best of luck with it but a bit of specialist help may be required. :-/