I have 21 badges on Stack Overflow:
My profile shows I only have 19:
However, the connotation between a total tag count is different between that and a total badge count, as the former is not displayed with your profile summary next to posts.
My suggestion would be to present a cumulative count for the badges on the profile page or perhaps include a distinction between unique and total badge counts.
Unrelated questions that all reference an inconsistency based on a different matter: