Please see the attached files.
test1.xml validates successfully, but the nested element <simple/> is highlighted in red as "Element simple is not allowed here". In fact, it should be allowed, because it matches ##other in the test2 namespace.
If I uncomment one of the lines in test1:simpleType definition, IDEA editor becomes happier and is able to resolve the nested <simple/> declaration, but validation fails with e.g. the following error:
cos-nonambig: WC["http://test/xsd/test1/test1"] and WC[##other:"http://test/xsd/test1/test2"] (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.
Issue was resolved