I'm currently working on a python script that I will be publishing as a geoprocessing service in ArcGIS Enterprise. I'm running into an issue with an arcpy function that works when debugging and when executing the script from ArcGIS Pro, but when it is published as a geoprocessing service the arcpy.ListTables() return None. I've set the arcpy.env.workspace to the same URL of a feature service in all of my testing, but only when it executes from the geoprocessing service does it fail. Any thoughts what's going on here? Is there certain arcpy functions that don't work in a geoprocessing service?
ArcGIS Enterprise 10.9.1
ArcGIS Pro 2.9.5
Code snippet

And here is the error, failing because arcpy.ListTables is None in the geoprocessing service context
esriJobMessageTypeError: Traceback (most recent call last): File "E:\arcgis\arcgisserver\directories\arcgissystem\arcgisinput\InformationFromSAMS.GPServer\extracted\p20\geoprocessors\Common.py", line 62, in LogMessageInDatabase integrationLoggingTable = FindTable(IntegrationFeatureServiceURL, "IntegrationLogging"); File "E:\arcgis\arcgisserver\directories\arcgissystem\arcgisinput\InformationFromSAMS.GPServer\extracted\p20\geoprocessors\Common.py", line 93, in FindTable for table in tables: TypeError: 'NoneType' object is not iterable