We have encountered a similar crash on iOS 15.2 (device & simulator), but not on iOS 14.4 (simulator) and have filed Feedback Assistant: FB9812333. Our public tracking issue is https://github.com/roblabs/Maps-for-Messages/issues/1
Issue
Uncaught exception NSInternalInconsistencyException while reviewing Apple Sample Code for iMessage apps.
Fails in Xcode 13.2 with an iOS 15.2 device & Simulator.
Same sample code works on iOS 14.4 simulator.
Same sample code works on Xcode 12.5 with an iOS 14.5 simulator.
Steps to reproduce
This is reproducible with open source code. Since we are reviewing the open source code, we are not sure how to proceed.
Review the sample code Creating a Sticker App with a Custom Layout posted at developer.apple.com.
Test with Xcode Version 13.2 (13C90)
Build for iOS 15.2 Simulator or iOS 15.2 device
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the view returned from -collectionView:viewForSupplementaryElementOfKind:atIndexPath: does not match the element kind it is being used for. When asked for a view of element kind 'section-header-element-kind' the data source dequeued a view registered for the element kind 'Text'.' terminating with uncaught exception of type NSException
The element kind reference, section-header-element-kind, is a string defined in the view controller class.
iOS 14.4 simulator works
While completing the same steps in an iOS 14.4 simulator, the Apple Sample code works.
Test with Xcode Version 13.2 (13C90)
Build for iOS 14.4 Simulator