Revised fix for SPR-12334, now finding duplicates at the collectImports level

Issue: SPR-12442