I actually called ESRI tech support on this particular issue and below is the Python code ESRI gave me as the solution to this issue. Instead of resetting the connection properties to another sde connection file, this Python simply just updates the password for each layer. After running some quick initial tests, it seems to work for me, with the exception of a layer that contains a join.
Python code ESRI provided
import arcpy, pprint
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]
for l in m.listLayers():
conProp = l.connectionProperties
conProp['connection_info']['password'] = '<new password>'
l.updateConnectionProperties(l.connectionProperties, conProp)
p.save()
## This may work as wlel if they are sure that only their database layers are broken in the project.
##for l in m.listLayers():
## if l.isBroken == 'True':
## conProp = l.connectionProperties
## conProp['connection_info']['password'] = 'sa'
## l.updateConnectionProperties(l.connectionProperties, conProp)
##p.save()
When there is a layer with a join, conProp can not find the 'connection_info', and this is due to it being split into two different sections, one for the layer's connection info and one for the connection info for the join. From what I found, it looks like you access the connection info for the layer and the join with the following code:
conProp['source']['connection_info']['password']
conProp['destination']['connection_info']['password']
When I put it all together, it should look like this:
import arcpy, pprint
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]
for l in m.listLayers():
conProp = l.connectionProperties
conProp['source']['connection_info']['password'] = '<new password>'
conProp['destination']['connection_info']['password'] = '<new password>'
l.updateConnectionProperties(l.connectionProperties, conProp)
p.save()
## This may work as wlel if they are sure that only their database layers are broken in the project.
##for l in m.listLayers():
## if l.isBroken == 'True':
## conProp = l.connectionProperties
## conProp['connection_info']['password'] = 'sa'
## l.updateConnectionProperties(l.connectionProperties, conProp)
##p.save()
After making that change, the Python still did not work to fix those layers and/or save the Pro project in Pro 2.3.3. It appears to run through the first layer of the map in the Pro project and then it stops with no errors or anything.
EDIT: All of the issues with the Python listed above not updating layers with joins and saving the Pro projects were fixed after I updated from Pro 2.3.3 to 2.4.1. Something in the Pro update fixed the issues.