Solution in the first post works for sure
Don't forget the fact that you are trying to migrate data from AcyMailing 4.9, which is a version released back in 2015. Also, at the same time, you are trying to do this from Joomla 2.5.x to J4. On top of that, the data in AcyMailing tables is not good and as you said by yourself, it has lots of duplicates
The data is not good because of problems with AcyMailing in the past, DB tables didn't have constraints and that resulted in duplicate entries. We don't run from that fact. Every software has its life cycle and there is no software without the bugs. We found those bugs, and we fixed them during the years. If AcyMailing was updated on a regular basis, the issue with the data would be solved long time ago
You should try to fix the duplicate entries first in Joomla 2.5 DB tables
After that, migration would be possible without many issues
Also, I would strongly suggest to use Joomla 3 as a middle man
Migrate everything to Joomla 3, do the proper AcyMailing upgrade and then migrate to Joomla 4