The definition of translational symmetry along a coordinate $q_i$ implies that under an arbitrary translation $$q_i\to q_i+\varepsilon,$$ the Lagrangian $L$ changes, at best, by the total derivative of a function $F\left(\{q_i\},t\right)$. If this happens, the momentum conjugate to $q_i$, defined as $$p_i=\partial L/\partial\dot{q}_i,$$ is conserved.
But the under a translation, $z\to z+\varepsilon$, the Lagrangian of a particle moving in a uniform gravitational field $$L=\frac{1}{2}m\dot{z}^2-mgz$$ changes to $$L\to L'=L+\frac{d}{dt}(-mg \varepsilon t).$$ But we know that $p_z$ is not conserved (because $z$ is not cyclic or alternatively because there is a force in the $z$-direction). Where is the flaw in the logic?