If two query modules each import a third module, and a user-written ModuleURIResolver is in use, then the ModuleURIResolver may be called twice to resolve the same URIs, causing it to return the same module twice; this will result in errors due to duplicate declarations of functions and global variables.
The problem arises because Saxon tests for duplicates by comparing the absolutized location hint of the new request against the resolved URI of the previous request (the systemId property of the Source object returned by the resolver). If these are different, Saxon will not detect that the request is a duplicate.
This is being fixed on the 9.3 branch by comparing the systemId of a Source returned by the module resolver with the system IDs of modules previously loaded; if the returned Source object is a duplicate, then it is not processed any further.
A more elaborate redesign will be undertaken on the 9.4 branch, avoiding the potential cost of fetching the same resource twice only to have the second and subsequent fetches discarded.
Fixed in 9.3.0.11