The bug still lives in 2.28.1.
I found that it should be related with filtering somehow.
In my mailbox settings I turned off 'Apply filters to new messages in Inbox on this server', deleted the folders as described above, and after the next synchronization I can see all of the missing messages.
I have no local mail filters set up, but when this box was checked, I can see my messages while the filtering process was running, but they disappeared immediately when this process finished, but still counted as unread in Inbox.
The bug still lives in 2.28.1.
I found that it should be related with filtering somehow.
In my mailbox settings I turned off 'Apply filters to new messages in Inbox on this server', deleted the folders as described above, and after the next synchronization I can see all of the missing messages.
I have no local mail filters set up, but when this box was checked, I can see my messages while the filtering process was running, but they disappeared immediately when this process finished, but still counted as unread in Inbox.