This is because arcpy.Rename_management does not work on a map layer object - it works on objects on the disk.
Instead try:
layer.name = newName
layer.name
is a read/write attribute of the arcpy.mapping.Layer class.
This is because arcpy.Rename_management does not work on a map layer object - it works on objects on the disk.
Instead try:
layer.name = newName
layer.name
is a read/write attribute of the arcpy.mapping.Layer class.