This is an interesting case, and sounds very similar to what we were dealing with in this other forum thread:
https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/create-model-states-using-ilogic/td-p/1...
It kind of seems like there might be a bit of a bug in the system related to running local rules when a ModelState other than "Master" is active.
I did a few fairly simple tests on this theory. When I have a part document open/active, I can run this one local rule (within that part) while this part is in either the "Master" model state, or when it is in another model state. (The rule just uses a MsgBox to show FullFileName of the part.) So that isn't it. Then I saved and closed this part (while it is still in the 'other' model state, and opened an assembly in which this part is represented in as multiple components, then used a simple local rule in that assembly to run the local rule in that component, it failed...the first couple times. That specifically named component was still set to its Master model state, while the part document itself was currently set to its 'other' model state. This caused the local rule in that 'component' to not be found, and therefore not to run. However, after I manually changed the model state of that component from Master to the other model state, it must have changed something in Inventor or in the session memory, because after that action, my local rule in the assembly was now succeeding in running the local rule in that component. This stayed true no matter which way I changed the model state of that component in the main assembly afterwards. This behavior really sounds like a bug to me. It seems like the model state of that component just needed to be messed with just that one time, before it would allow the rule in that component to be found, then it didn't matter what following changes were made, including setting it back to the way it originally was when the problem existed, but the problem no longer exists when set back that way.
Wesley Crihfield

(Not an Autodesk Employee)