Handles message delivery failed events by adding error messages to the chat.