I think we can review the idea of working with iterators/heaps based on local UoW. Since it's localized it will be much safer to predict collisions. In this particular case, the ID has not been confirmed by the database, so the local index for it does not exist.
One of the options I can suggest - we can build local indexes on a level of UoW/EM itself, which seems much more logical instead of going back to Heap.
By @wolfy-j in https://github.com/cycle/orm/issues/392#issuecomment-1383118207
By @KorDum in https://github.com/cycle/orm/issues/392#issuecomment-1383181491