On both Ventura 13 and beta 13.1 this failed but in Monterey it works fine.
I tried tccutil reset Contacts and I got tccutil: Failed to reset Contacts
I tried tccutil reset AppleEvents and it was successful.
I restarted and tried again.
I executed count of groups again and I was asked to allow Contacts to be controlled. I answered yes and then I got Not allowed as in the attached screen shot
Thanks for your help