This issue is not reproducible with the latest version of ArcGIS Pro . In_memory is a legacy workspace and is not used with layers. Migrating to memory workspace should be used. Refer to: https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm