`loaded_items` is only used here to skip reloading a module, but it would be rare and not msfcli-specific to have two different parent paths with the same `module_refernence_name`.  The only time I can see this normally being an issue is if you somehow added the same module path twice, in which case the parent path should be deduped earlier in the code before `load_modules` is called.  The other case would be if a user copied a module from one parent_path to another parent_path, which should be counted as an error, you can't have two modules with the same reference name on the same path.  Were you actually see duplicate reference names as a problem in your manual testing.