I think I know what happens, it's one I have banged my head against in the past
It happens that if an error stops the migration then the migration of the attribute sets does not get reverted, and several tables get left in a state that will break the next migration attempt. So the next time you will get undefined offset, then duplicate entry, then undefined offset, then duplicate entry
m2's eav_attribute_set table ends up containing the "migration_"
entries after the undefined offset error or any other error during a
further substep of the eav process (hence causing the "duplicate"
error next time)
m2's eav_attribute_set table ends up completely empty after this
error (causing the "undefined offset" error next time as the default entries are missing)
on and on forever
Note that you first have to have another error, like missing document.
Ideally you keep a snapshot of the eav_attribute... tables and reset them.
For those struggling, I have managed to pass through by MANUALLY (in SQL) rebuilding the eav_attribute_set and eav_attribute_group tables in the database to have only the original entries, but with the IDs from after my first migration
But if I then get another error in the EAV step (eg: class name reference from a module I am not planning to migrate) then this error is back on the next run so I have to do that manual clean up over and over.
See my second comment on this issue on the migration tool bug tracker for details of the SQL https://github.com/magento/data-migration-tool/issues/204 to