This indicates that compositional layout is trying to resolve layout for a section that doesn't exist in the data source.
This was the issue on my case, however my data source was returning the correct sections (like if the compositional layout had a cache), invalidating the layout worked for me:
collectionView.collectionViewLayout.invalidateLayout()
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: