RM and LCM have no relationship with respect to lock codes. RM gets the available codes from the lock itself. Perhaps that's the same thing for you. If the code isn't in the lock, RM can't see it.
But, you can get around that by using a Custom Attribute on the lock, for the attribute 'lastCodeName'. So if at some point that code name is used for a code in the lock, that would trigger a rule. And this happens without RM querying the lock in advance to know what codes it has.