Script to delete all groups in contacts
The reason that script doesn't delete all the bogus groups is that it only repeats 50 times, so it will only delete 50 in one go.

This script will delete every group with the name that you input (it asks you with a dialog box) until it can't find any more:

set counter to 0
display dialog "Name of group to delete?" default answer ""
set theGroupName to text returned of result
tell application "Contacts"
    repeat
        try
            set theGroup to group theGroupName
            delete theGroup
            set counter to counter + 1
        on error
            exit repeat
        end try
    end repeat
    save
    display dialog "Removed " &amp; counter &amp; " instances of the group" with icon caution buttons {"OK"} default button "OK"
end tell