Unhandled COMException is thrown when the MessageGroup elements are removed from the chat's visual tree. This can happen when the group view models are removed from the MessageGroups or MessageListItems collections.
To work this around, you can get the corresponding MessageGroup container and set its DataContext to null before removing the MessageGroupViewModel from the MessageGroups or MessageListItems collections.
var groupVisuals = chat.ChildrenOfType<MessageGroup>();
foreach (MessageGroup group in groupVisuals)
{
group.DataContext = null;
}