CyberGene the read status is stored as a combination of the discussion ID and the last read post number. The new reply state is computed based on the difference between the last read post number and the last post number.
So yes, I suspect deleting the last post of a discussion can mess this up, since it doesn't revert the unique post number counter for that discussion.
I'm not 100% sure about those permanent deletes, but I've definitely seen similar issues with posts that only some people can see, like posts under approval or soft-deleted posts. Since the user can't see them, those posts won't be marked as read and the user therefore can't have the full discussion marked as read until new posts become visible.
There's one "button" that's unaffected by this, it's the "Mark as read" control of a discussion that will always save the last post number as the last read number, even if that post is not visible. But that button is well hidden, it's not in the controls dropdown, it's what happens when you slide a discussion left or right from the discussion list on mobile.