Content type operations within a list

Problem

M2 can't resolve a content type by giving ID within a list

Explanation

Correct, M2 can't resolve a content type by ID withib a list. By design, SharePoint API limitation.

The thing has to do with the SharePoint API and "BestMatch" method wich would try to find the best content type much within a list by giving ID. Target list might have several content types inherited from the same parent, yet the actual, real ID of the content type within a list will be unique to that list - SharePoint adds additional GUID to the content type ID. In that case the SharePoint's API best match would not work correctly returning almost random results and incorrect content types.

Solution

Use content type name while adding, hiding or deleting content types within a list.

Links

https://www.yammer.com/spmeta2feedback/#/Threads/show?threadId=589986330