I went through a lot of articles and documentation. Everywhere UICollectionViewCompositionalLayout is used alongside UICollectionViewDiffableDataSource.
supplementaryViewProvider is used to dequeue the supplementary view. But how to get it invoked while the layout is UICollectionViewFlowLayout.
You have to add boundarySupplementaryItems while configuring your NSCollectionLayoutSection. Something like: