In 3.x API, whether a webmapid is used to create the map object or not, layers in the map seem to be ordered by what type of Map Service they are. No matter what order they're added to the map object.
This is the order, top to bottom, based on my observations:
With 4.x API, I'm not seeing the same logic, it's like it creates a Web Map sandwich:
What I'm hoping for is that dynamic map services and/or feature layers not in the web map would be able to draw on top, but they aren't. They're getting covered up by the WMS Web Map layer. Again, this regardless of what order they're added to the map.
Mitchell,
I am not sure on the order portion of the question but you can always reorder the way you want :
https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#reorder