It happens because the gears don't totally slide all the way into position and just freewheel next to each other instead of engaging. Bikes prefer good, strong, crisp shifts. The shift drum is not going into the next position, and thus the forks can't push the gears all the way over.
It's nothing to worry about just put a little more emphasis into your shift. And yes over time it should smooth out.