My partner has an XS Max and the same issue happens when he is composing an email and he receives a call or text. If he leaves the email screen to answer the phone, the unfinished email will have vanished when he returns to it. So it’s not just iMessage or text message but in emails also.