I'm using the API to overwrite hosted feature layers and vector tiles using the technical support article below. If ArcGIS Pro isn't running, feature layers don't get overwritten but vector tiles do. I receive an error saying, "Error Creating and Republishing Service Definition file for <layer name>. ValueError('Unable to connect to portal.')". As soon as I open ArcGIS Pro and run the script, the feature layers do get overwritten. I don't even have to be connected to portal. Any ideas? This one has everyone stumped, including ESRI!
Overwrite hosted feature services from ArcGIS Pro to ArcGIS Online using Python
https://support.esri.com/en/technical-article/000023164