Usually a nylon type locknut will not come loose.I can see if it were a threaded bolt into an aluminum or mag case.
If it threads into the case chances are it's wallowing out the threads.Red Loctite is about the only choice you have other than tapping out for the next size.
A ha ha,the old...