I believe that Emma (with Nimue inside her) uses Merlin’s heart (maybe with his permission) to cast the curse to get Merlin untethered from Excalibur and everyone away from whatever dire danger Arthur put them in after this episode. Nimue still loves Merlin the most.
Side note: We need a Lancelot hearing from Merlin in childhood story. Maybe Nimue was pregnant and is Lancelot’s mother. Maybe Nimue becomes a Nyx or Lady of the Lake like character. Lancelot is Lancelot du Lac.
And where was Lance this episode anyway? And why didn’t anyone mention Belle?