Views created programmatically from services that have non-sequential layer ids are unusable. I created a view from this code:
source_search = gis.content.search("test_20240608_unique_ids_assigned_all_around")[0]
source_flc = FeatureLayerCollection.fromitem(source_search)
new_view = source_flc.manager.create_view(name="unid_all_around_view")
Source-Service layer ids:

View layer ids:

When the view is opened in the map viewer, the layers are messed up. The Route line layer has become a point layer and one of the point layers (the one with the very long name!) has become a line. A complete mess.

This happens consistently, on more than one platform. It does not happen when views are created manually. Also, create_view works fine when the layers are ordered sequentially 0 to N, top-down.