Status bar shows as gap when pinning/docking/fixing something to the top

I have an item pinned to the top of the page that displays after it passes another object.

This works on many phones but I’ve noticed on an iPhone XS (and I assumed newer too), it pins it BELOW the status bar as you scroll, which results in a gap. It doesn’t do this on older iPhones (example - 6/7/8).

Any ideas around this?

image

image