You’re relying on one of these oddities of IMAP, the \Recent flag. Opening a folder in read-write mode will reset the \Recent flag on all messages in that folder.
I believe there are conditions where K-9 Mail 5.600 opens a folder in read-write mode when it doesn’t have to. Try using the latest beta version. See How do I become a beta tester?