Going through a batch of shp files to obtain a geospatial aggregate count of a feature. When using, Summarize Within fails with 100014 on arcpy after one iteration. But same code executes within the ArcGIS pro pythin notebook. I have a large number of files to process and want to get it running on arcpy as it runs much faster than the notebook. I have noticed that a lock is placed on the aggregation polygon layer when executing the first iteration and after that most probably due to the lock, Summarize Within fails. Error thrown is very generic 100014. Any thoughts on fixing this?