The situation should be that you are querying the referencing documents for a model state factory document instead of model state member document. When you have an assembly document, and it has several model states, and place one model state to drawing document, it has below reference structure:
Assembly1.iam
|____Assembly1.iam<Model State1>
|____Assembly1.idw
The Assembly1.iam is a model state factory document, check ComponentDefinition.IsModelStateFactory, the Assembly1.iam<Model State1> is a model state member document, check PartComponentDefinition.IsModelStateMember). So the model state factory document will reference to the model state member document, and then the model state member document references to the drawing document. So in your code you should firstly check your document is a model state factory or member document.
Thanks,
Rocky
Can't find what you're looking for? Ask the community or share your knowledge.