Let's recap what actually happened.
In April 2015 a deal was reached between the Iranian government on the one hand and the EU, USA, Russia and China on the other to lift sanctions on Iran if they stopped work on their nuclear program. As part of the deal about $2bn in Iranian money frozen around the world would also be unfrozen.
The EU and Obama thought that the "moderate" government in Iran would use this money to boost spending within Iran to win votes in future elections.
What seems to have happened instead was that the money went to Assad in Syria.
Suddenly Assad went from being on the ropes to having weapons. He tried to conscript Syrian males to participate in his army.
By July 2015 they started to leave Syria and head for Europe to seek asylum, and the migration continued throughout the wiinter and into 2016. It only stopped when Europe bribed Turkey to patrol the Mediterranean.
Iran of course wouldn't have had the money to help Assad if not for the deal. The mistake the west made was that they believed that the moderate govt in Iran was different from the hardliners. Turns out the differences between the moderates and hardliners are only on domestic policy. On foreign policy they both think alike.
Regardless of the intentions at the time, it's amazing that the EU is clinging so hard now to a deal that hurt them.