That looks like it was a bug with the automation rather than a custom badge?
I remember we talked about these badges before (Amending sample Gamification scoring badge - #2 by JammyDodger). Have they been playing up this whole time, or is this a recent thing?
Without testing, one of the things that looks like it doesn’t belong is the ‘AND NOT EXISTS’ section. Are you trying to handle not awarding multiples within the query itself?