Abilities that mention a card by name are tied to that specific copy of the card, not any card with that name, those few that are specify "cards named X" like Accumulated Knowledge, Detention Sphere or Demigod of Revenge. This means that the triggered ability of Etrata, the Silencer is tied to the specific copy of Etrata that had swung, you do not get to choose which copy of a creature will be subject to an effect that mentions that creature by name.
You also cannot cast anything while an effect is resolving, there are things in Magic that cannot be interrupted. Players need to have priority to cast spells, most magic players quickly pick up how priority moves and are able to follow that and cast spells, no player has priority while a spell is resolving, and the full spell must resolve before any player gets priority. You would also need to be able to cast Quasiduplicate, a sorcery, at instant speed, this can be done through effects like Quicken or Leyline of Anticipation.
Copying a legendary creature causes the legend rule to apply, this happens as a state based action, as soon as the copy is on the field, before any player gets priority, all but one copy of that creature you control must be sacrificed. The only way around this is through Mirror Gallery which removes the legend rule while it is in play, or copies like Sakashima the Impostor which keep their own name, so the rule doesn't apply.
If the goal is to avoid shuffling Etrata into the library, the best way to do this would be to bounce or flicker her while her ability is on the stack. You could have Brago, King Eternal, Mistmeadow Witch or Deadeye Navigator as instant speed and repeatable ways of flickering her, breaking the connection between Etrata the card and the ability on the stack. Removing the source of the ability once it's on the stack does not stop that ability from resolving, so you still get the exile, still move towards the three hit loss for your opponent.