Your script works for me on Catalina, but it's always best to stick to the AppleScript rules to avoid unexpected issues with system updates.
Better, place both count command and display dialog command out of Contact's tell block. Because both of them are not Contact.app commands (count is not property of people as well to use syntax "of people"). The display dialog expects some text value for its parameter, so it is better to apply explicit coercion for counting result (which is an integer). At least on my Catalina following works:
tell application "Contacts" to set personsList to people
set cc to count personsList
display dialog (cc as text)
If the people is broken on Ventura, maybe every person will work:
tell application "Contacts" to set personsList to every person
set cc to count personsList
display dialog (cc as text)
Also, try to add the keyword its before people. Sometimes this helps with conflict solving.
Sometimes helps providing app constant and compiling at runtime as well:
set personConstant to "«class azf4»"
set personsList to run script "tell application \"Contacts\" to every " & personConstant
set cc to count personsList
display dialog (cc as text)
Now, if nothing works, try following script in the Script Debugger to see what structure has the application on Ventura. It will show you what is broken as well. Open variable contactsApp in Variables window to see what happens:
tell application "Contacts" to set contactsApp to it
One last suggestion. Go to Security&Privacy pane of System Preferences, click on Contacts, see if your script editor is in applications which has access to Contacts. If not then add it, in other case - remove it than add again.