Impact of vertical gas accretion on the carbon-to-oxygen ratio of gas giant atmospheres