Client incorrectly spawns projectile

When the client shoots, sometimes the bullets are only shot in the horizontal direction the character is aiming, the pitch / vertical aim is ignored. After a little time, it starts working perfectly, shooting exactly where I aim, but then goes back to the original problem again. The server works fine regardless.