I would have thought the later scan would be able to show bubs sex more accurately.

but they do get it wrong sometimes. My cousin got told they were having a girl and they ended up having a boy.