Ok I did some some experimentation with old saves. I loaded a save after I got the trade quest from Vincent, but before returning for the leaden key ambush. I went to twin elms, triggered the conversation with the anamfath, and the quest showed as completed. Going back, the leaden key attacked, I killed them, vincent and the vailians were friendly, but told Pallegina their would be consequences for what she did, and wishing her 'god speed' pretty much. I don't want to play this earlier save to the end, as I just finished the game yesterday with my main playthrough (where the amanfath would not talk to pallegina about trade). Pallegina had no proper final dialogue or epilogue for me as I did not technically finish the quest, and I do not want to reload the old save, do the quest properly, and finish it again with the same character, so I guess I will just miss out on Pallegina's final dialogue and epilogue. So it seems if I load an old save and talk to the anamfath before the ambush, the quest can complete. Note, in the main playthrough, I went to Twin Elms, did not go into the hall of the six, and continued questing near Defiance Bay, and happened to go back into the Vailian embassy, where, as I said, the battle occured and Agosti died. Returning to Twin Elms, I could not talk to the anamfath about Pallegina, so I continued with other quests.
So it seems that either:
a) The game assumes Pallegina has made the trade agreement upon arriving at Twin Elms, and the ambush at the embassy occurs next time you visit. Perhaps the game should only assume you have done it, after the dialogue with the Anemfath triggers. Is the leaden key attack at the embassy supposed to occur only AFTER you make a trade deal?
b) I accidentally hit a Vailian soldier, borking the progression. Although, I will note, after Agosti died, there was a dialogue comment by Pallegina stating that although he was dead, she needed to proceed with the trade agreement.
c) You need to do the twin elms quest before advancing too far in the main storyline, causing the leaden key ambush to occur.
Either way, my progression in the quest was messed up by going back to the embassy and experiencing the ambush, rendering it impossible for me to talk to the anamfath. Whatever the cause was, it happened during that ambush.