I am attempting to use arcpy.SelectLayerByLocation_management() to select polyline objects on a given layer based on their relationship to a point, but any time I run the code outside of Arcgis (in PyCharm) it results in a crash where an ESRI error report box pops up with nothing printed to console that I can see.
import arcpy
projRoot = arcpy.mp.ArcGISProject("./dat/project/project.aprx")
mainMap = projRoot.listMaps("Map")[0]
roadLayer = mainMap.listLayers("story_county_roads")[0]
arcpy.SelectLayerByLocation_management(roadLayer, "CONTAINS", arcpy.PointGeometry(arcpy.Point(461715.4856701, 4656029.4532028)))
the above is the entirety of a minimized file I created to test the error and seems to run fine when pasted into an instance of Arcgis Pro using "CURRENT" instead of a path for the project, however using the path still results in a crash even when running in Arcgis. what would be the proper way to use select layer by location externally if the above is broken?