On the Compositional Generalization Gap of In-Context Learning