As seen from the blue shading, I only had 2 new messages, but the red indicator showed 6. Such mismatch is very frequent. The blue shading is always right.
It's admittedly a bit confusing, but not really a bug.
If you get 10 comments on the same post, the inbox indicator will show 10 with a red background, but only a single thread will be displayed in your inbox. Likewise, several answers to the same question get gropued as well and will show up as a single item in the dropdown.
To keep track of unread answers and comments, you can navigate to the responses tab in your profile. (direct link) Items with a yellowish background indicate new responses since the last time you visited the tab.