Apps Script has deprecated the Contacts service. Instead, use the People API advanced service. Refer to Migrate from Contacts service to People API advanced service.
Having taken bit of a break from Pulse over the festive period I had missed the December release note announcing the deprecation of the Contacts service,
ContactsApp. There isn’t much time to update your code as the service will no longer function after April 30, 2023. Google have however provided detailed guidance on migrating from Contacts service to People API advanced service.
[HT to Pablo Felip @pfelipm for flagging this update on Twitter]
Source: Release Notes | Apps Script | Google Developers
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.