Common problem, easy fix.
But ya gotta take the lock out of the stock and clean it,,(Heaven Forbid!)!!
So ya got that part,
,take the lock out, spray it down with a de-greaser and wash it or hit it with brake cleaner and compressed air or both, too clean all the old oil gum and grime off it.
Everything should be clean and dry.
While you have it out,, play with it, honest,, work the action and see how it functions.
A couple drops of oil, aka; A Couple Drops of Oil,, really helps those moving parts function.
The fix;
All those moving parts are held in place by a plate with 3 screws,, all those 3 screws have to be TIGHT for those parts to work proper.
If any of them are the tiniest bit loose, the fly detente will tip in it's position and stop the locks function in any of several positions short of hammer/nipple contact.
The only reason the lock worked with the adjustment all out, is because the front cam then rides high enough to by-pass the adjustment.
Nothing is wrong or broken with the lock,, it just needs some TLC