Let me recall some of the discussion in M. Henneaux and C. Teitelboim, Quantization of Gauge Systems. Princeton University Press, 1992. for context. Assume we have a constrained Hamiltonian system with an action $$S(q,p,\lambda)=\int dt\left(p_i\dot{q}^i-H(p,q)-\lambda^m\phi_m\right).$$ The equations of motion are then $$\dot{F}=\{F,H\}+\{F,\phi_m\}\lambda^m.$$ The requirement that the constraints are preserved in the evolution of the system then leads us to the consistency conditions $$\{\phi_m,\phi_n\}\lambda^n=-\{\phi_m,H\}.$$ This is a set of linear equations for $\lambda^m$. However, it may not have solutions at every point on the constraint surface. Thus, the points at which it thus admit solutions define a new constrain surface obtained by adding new constraints to $\phi_m$. Let us denote the old constraints along with the new ones by $\phi_j$. We now have new consistency conditions, leading us to $$\{\phi_j,\phi_m\}\lambda^m=-\{\phi_j,H\}.$$ These may again not have solutions everywhere, leading to a new constraint surface and the need to add new constraints to the $\phi_j$'s.
Let us assume that the process has terminated and we are left with a set of consistency conditions with solutions everywhere on $\phi_j=0$. Then, the solutions for $\lambda^m$ are of the form $\lambda^m=U^m+v^aV^m_a$, where $U^m$ is a particular solution to the consistency conditions, $V^m_a$ is a basis of the kernel of $\{\phi_j,\phi_m\}$ and $v^a$ are completely undetermined. This allows us to define a first-class Hamiltonian $H'=H+U^m\phi_m$.
Here is where I am confused. On the initial constraint surface $H$ and $H'$ coincide. Since form the Lagrangian formulation one can only determine the Hamiltonian on this initial constraint surface, we could've decided to start with $H'$ instead of $H$, i.e. with the total action $$S_T(q,p,\lambda)=\int dt\left(p_i\dot{q}^i-H'-\lambda^m\phi_m\right).$$ However, from this action, the initial consistency conditions would've been $$\{\phi_m,\phi_n\}\lambda^n=0$$ since $\{\phi_m,H'\}=0$. These are clearly consistent, for they only require that $\lambda^n$ be in the kernel of the square matrix $\{\phi_m,\phi_n\}$. Then, how would've we recovered the rest of the constraints $\phi_j$?