Several cases of incorrect counter behavior. Since it's a regression bug, all cases, most likely, have the same reason.
1. Login as a user who has unread notificaitons.
2. As the same user, log in to another wiki - the wiki where a user does not have any local notifications, i.e. never was logged before.
- all wikis have "Cross-wiki notifications" enabled (by default)
- Special:Notifications page's counters and the page itself display correct info
- the issue is relatively mild - often goes away upon re-login, or refreshing manually the page.
3. There are several outcomes
(A) The badge counter shows 0, but the expanded panel shows a different number.
Below is the case when the badge counter and the panel counter agree, but according to Special:Notifications page, there are cross-wiki messages.
(B) The badge counters show correct numbers, but the expanded panel shows "You have no notifications" message.
(C) Quite often 'Failed to fetch notifications" message is displayed.