When the nut is loose can you turn the gear under it? It should have no play in it.
If the nut has been left loose to long the key and keyway will flog out which alows the gear to turn back a forward a few degrees.
If this has happened no amount of loctite or big spanners are going to stop that nut coming loose.
I had the same problem with mine so I fixed it by getting the next size key up and then grinding it down until it was a snug fit in the worn keyway.
I then put red loctite on the shaft then slid the gear on, loctited the nut and tightened it with the air rattle gun as tight as it would go.
It's never come loose since.
If I ever need to take it off a bot of heat and the rattle gun will break it loose.