The original nut fitted was too thin (9mm as opposed to the 12mm thick replacement part) and can work loose. Mine could well be original (I think it was 9mm but no way of knowing for sure now) and the bike has 33k on it. I've had it since May when it had 24k and have checked it a few times, it's always been torqued up correctly.
There's not a lot of damage to the cover, few marks from where the nut has spun against it before falling off, but the main damage is done to the shaft which is an engine/box out and disassemble job. I don't reckon threadlock would be up to the job tbh, the amount of vibration it must be subject to it'd probably still work loose.
My sprocket came off at about 10mph as I pulled away at a mini roundabout and looking at the shaft again I reckon it's saveable, although it won't be just a nut... welding is probably the quickest and most secure way I reckon. Will just have to replace the nut whenever I do the chain/sprocket. Just glad it didn't come off at 70mph as it would've been proper knackered then