It'd be great if there was a way to easily replicate the out of the box workflows for publishing a Layer to Portal. I've been trying to replicate the workflow that is performed using the method right-click the Layer, select Sharing > Share As Web Layer, using arcpy.
Looking at the staging folders, there are several artifacts that are created during the publishing process and the SD draft XML looks different - mostly the same but different enough - than using the arcpy.mp.Map.getWebLayerShaingDraft() function. See additional post https://community.esri.com/t5/arcgis-api-for-python-questions/publish-a-map-image-layer-with-feature... that covers one of the other differences that I've noted. There are also other items such as the Document Info that seem to be different and I'm sure there are other things I have missed.
If this isn't that straightforward then at least provide better documentation on the process and properties available in an SD draft file.
Another option would be to allow users to configure default publishing settings so that they don't have to be edited to meet an organisations standards each time.