I have found (and fixed) one issue that does indeed cause this. Since this issue should be rare, and given the amount of people who have reported this, I'm not totally convinced that this was the only issue. Hence I'm not calling this status-completed yet; I'll be watching it for a while.
Please let me know if you see this again (or don't see it again for a long time).
Note that your "expected behavior" is not at all expected – if a new message is flagged, you should very well get a notification of this.
Update. As several people (including myself) noticed, this indeed was not the main issue. As always, the problem was with cachingand timing. The flag count that's displayed to you is cached on the server side, and this cache is only cleared when a new flag-relevant event happens. When your chat client receives a flag event, it queries the server for an updated flag count to display to you.
However, since you received the flag event from the websocket server (this issue wouldn't have appeared for users without websocket-supporting browsers), but get the flag count from the regular webserver, it can happen that the latter hasn't processed the new flag event yet and thus hasn't updated the cache yet, while the former is already happily handing the event out to clients.