This is not just an Astarion issue. The same happens for Lae'zel leaving to fight in the revolution, characters leaving with Lae'zel and characters killing themselves, from what I have read. (There used to be a bug in which characters leaving with Lae'zel could still intervene in Karlach's scene, I am unsure if this has been patched) This makes it an issue that cannot be solved by "simply" changing the order in which the companion scenes play (I doubt this is that simple to manage) but could for example be solved by handing over controls to Wyll once the main character has left the dock.