:flag a message and then you try to filter with
:filter -x flagged it won't show it. What it shows
for me looks like the messages which was flagged at some point of the time, but it's just a guess, but the
result of the query is not empty, that's what I'm saying.
Everything works as expected without notmuch with just maildir.