arcpy.management.ApplySymbologyFromLayer() works from a standalone script, or the Arc Python window, but NOT from a toolbox script inside a map session. It executes without an error, but it doesn't change the symbology.
The only possible reason I can see is that the object type is a little different for a layer depending on whether it's a standalone/python window or the toolbox script.
standalone/python window layer type: <arcpy._mp.Layer object at 0x000001C3E7390C10>
toolbox script layer type: <MappingLayerObject object at 0x000001AEA43E2270>
Does anyone know what's going on?? I have run into other weird glitches with ArcGIS Pro where tools function differently in toolbox scripts, and it's very frustrating.
Script example that only works if run as a standalone script:
