A duplicate mod from the mods folder can't be deleted when a unique (non-modpack) mod depends on it, due to nonModpackFilesToDelete being evaluated after dependency resolution, only the (non-modpack) mod marked to delete is going to be removed. On the next boot, automodpack will detect the duplicate mod without dependencies and delete it, causing an unnecessary restart popup.