Interesting, DavMail flag implementation is based on two MAPI properties:
PidTagLastVerbExecuted, PR_LAST_VERB_EXECUTED, ptagLastVerbExecuted
PidTagIconIndex, PR_ICON_INDEX, ptagIconIndex

This implementation is quite old (back to old Exchange 2003/2007 over WebDav) and finely tuned to match Outlook behaviour.

However this was not compared with Exchange native IMAP support. According to your tests IMAP support seem to be different. You can check exact message properties values with EWSEditor.

Maybe the issue is related to PidTagLastVerbExecutionTime ?