I) Let us suppress position dependence $q^i$ and explicit time dependence $t$ in the following, and also assume that the Lagrangian $L=L(v)$ is a smooth function of the velocities $v^i$, where $i=1, \ldots, n$. The Hessian matrix is defined as
$$ H_{ij}~:=~\frac{\partial^2 L}{\partial v^i \partial v^j}.\tag{1}$$
Let us consider an open neighborhood$^1$ $V$ around a fixed point $v_{(0)}$. Now a very important assumption is the so-called regularity condition, cf. Refs. 1 and 2. This means that the rank of the Hessian $H_{ij}$ should not depend on the point $v$. In other words, the Hessian $H_{ij}$ should have constant rank $r$. (Ref. 3 implicitly assumes this crucial point without stressing its importance.)
We now permute/rename the velocities $(v^1,\ldots, v^n)$ such that the $r\times r$ minor $A_{ab}$ is invertible in the top left corner of the Hessian
$$ H~=~ \begin{bmatrix} A & B \\ C & D \end{bmatrix}
~=~ \underbrace{\begin{bmatrix} 1 & 0 \\ CA^{-1} & 1 \end{bmatrix}}_{\text{invertible}}
\begin{bmatrix} A & 0 \\ 0 & D-CA^{-1}B \end{bmatrix}
\underbrace{\begin{bmatrix} 1 & A^{-1}B \\ 0 & 1 \end{bmatrix}}_{\text{invertible}}. \tag{2} $$
The renaming is assumed to be done in the same way in the whole neighborhood $V$. This is possibly by going to a smaller open neighborhood (which we also call $V$) if necessary. (Later when we apply inverse function theorem below we might have to implicitly restrict $V$ further.) It follows from the constant rank condition that
$$ D~=~CA^{-1}B. \tag{3}$$
II) We next perform the singular Legendre transformation $v\leadsto p$. Define functions
$$ g_i(v)~:=~\frac{\partial L(v)}{\partial v^i}, \qquad i=1, \ldots, n. \tag{4} $$
The momenta are defined in the Lagrangian theory as
$$ p_i~:=~g_i(v), \qquad i=1, \ldots, n. \tag{5}$$
The velocities
$$ v^i~\longrightarrow~ (u^a,w^{\alpha}) \tag{6} $$
split into two sets of velocity coordinates
$$ u^a, \quad a=1, \ldots, r,
\qquad\text{and}\qquad
w^{\alpha}, \quad \alpha=1, \ldots, n-r, \tag{7}$$
which we shall call primary expressible (unexpressible) velocities, respectively [2]. Similarly, the momenta
$$ p_i~\longrightarrow~ (\pi_a,\rho_{\alpha}) \tag{8}$$
split into two sets of momentum coordinates
$$ \pi_a, \quad a=1, \ldots, r,
\qquad\text{and}\qquad
\rho_{\alpha}, \quad \alpha=1, \ldots, n-r. \tag{9}$$
The primary expressible velocities
$$ u^a~=f^a(\pi,w), \qquad a=1, \ldots, r. \tag{10}$$
are extracted from the $r$ first momentum relations (5) via the inverse function theorem with the $w$-variables as passive spectator parameters.
III) Next define composite functions
$$ h_i(\pi,w) ~:=~ g_i(f(\pi,w),w), \qquad i=1, \ldots, n. \tag{11}$$
It follows immediately that
$$ h_a(\pi,w) ~=~ \pi_a, \qquad a=1, \ldots, r. \tag{12}$$
because the functions $g$ and $f$ are each other's inverse for fixed $w$. Differentiation of (12) wrt. $w^{\alpha}$ leads to
$$ \begin{align} 0~\stackrel{(12)}{=}~&\frac{\partial h_a(\pi,w)}{\partial w^{\alpha}} \cr
~\stackrel{(11)}{=}~&\left.\frac{\partial g_a(u,w)}{\partial w^{\alpha}}\right|_{u=f(\pi,w)}
+\left. \frac{\partial g_a(u,w)}{\partial u^b} \right|_{u=f(\pi,w)}
\frac{\partial f^b(\pi,w)}{\partial w^{\alpha}} \cr
~\stackrel{(1)+(2)+(4)}{=}&\left.B_{a\alpha}\right|_{u=f(\pi,w)}
+\left. A_{ab} \right|_{u=f(\pi,w)}
\frac{\partial f^b(\pi,w)}{\partial w^{\alpha}} . \end{align}\tag{13} $$
Theorem 1. The $h_i$-functions (11) do not depend on the $w$-variables.
Proof of theorem 1:
$$ \begin{align} \frac{\partial h_{\alpha}(\pi,w)}{\partial w^{\beta}}
~\stackrel{(11)}{=}~&\left.\frac{\partial g_{\alpha}(u,w)}{\partial w^{\beta}}\right|_{u=f(\pi,w)}
+\left. \frac{\partial g_{\alpha}(u,w)}{\partial u^a} \right|_{u=f(\pi,w)}
\frac{\partial f^a(\pi,w)}{\partial w^{\beta}} \cr
~\stackrel{(1)+(2)+(4)}{=}&\left.D_{\alpha\beta}\right|_{u=f(\pi,w)}+\left. C_{\alpha a} \right|_{u=f(\pi,w)}
\frac{\partial f^a(\pi,w)}{\partial w^{\beta}} \cr
~\stackrel{(13)}{=}~&\left. \left(D_{\alpha\beta}-C_{\alpha a}(A^{-1})^{ab}B_{b\beta} \right)\right|_{u=f(\pi,w)}\cr
~\stackrel{(3)}{=}~&0.\end{align}\tag{14} $$
End of proof.
Theorem 1 answers OP's question. Let us for fun continue with a few more steps of the Dirac-Bergmann analysis.
IV) The $n-r$ last momentum relations (5) now become $n-r$ functionally independent primary constraints
$$ \phi_{\alpha}(p)~:=~\rho_{\alpha}- h_{\alpha}(\pi)~\approx~0,\tag{15} $$
where the $\approx$ symbol means equality modulo constraints or EOMs.
The primary constraints (15) are clearly functionally independent as each of them depend on different $\rho$ momenta.
V) The Lagrangian energy function is defined as
$$h(v)~\stackrel{(4)}{:=}~g_i(v) v^i -L(v).\tag{16}$$
Define the canonical Hamiltonian as a composite function
$$\begin{align} H_{\rm can}(\pi,w)~:=~~~~~&\left.h(v)\right|_{u=f(\pi,w)}~=~h(f(\pi,w),w)\cr
~\stackrel{(10)+(11)+(16)}{=}&\underbrace{h_a(\pi)}_{=\pi_a} f^a(\pi,w) +h_{\alpha}(\pi) w^{\alpha} - L(f(\pi,w),w).\end{align}\tag{17}$$
Theorem 2. The canonical Hamiltonian (17) does not depend on the $w$-variables.
Remark. The canonical Hamiltonian (17) also does not depend on the $\rho$-momenta by construction.
Proof of theorem 2:
$$\begin{align} \frac{\partial H_{\rm can}}{\partial w^{\alpha}}
~\stackrel{(17)}{=}~&\left(h_a(\pi) -\left. \frac{\partial L(u,w)}{\partial u^a} \right|_{u=f(\pi,w)} \right)
\frac{\partial f^a(\pi,w)}{\partial w^{\alpha}}
+ h_{\alpha}(\pi) -\left.\frac{\partial L(u,w)}{\partial w^{\alpha}} \right|_{u=f(\pi,w)} \cr
~\stackrel{(4)+(11)}{=}0.\end{align}
\tag{18}$$
End of proof.
VI) Let us define the extended Hamiltonian [2]
$$ H_E(v,p)~:=~p_iv^i-L(v), \tag{19}$$
and the primary Hamiltonian
$$ H_{\rm prim}(w,p)~:=~\left. H_E(v,p)\right|_{u=f(\pi,w)}~\stackrel{(15)+(17)}{=}~H_{\rm can}(\pi)+w^{\alpha}\phi_{\alpha}(p).\tag{20} $$
Note that the $w$-variables act as Lagrange multipliers.
VII) One may show that Lagrange equations
$$\left. \frac{d}{dt}\frac{\partial L}{\partial v^j}\right|_{v=\dot{q}}~\approx~\frac{\partial L}{\partial q^j} \tag{21}$$
are equivalent to Hamilton's equation in the following form
$$ \begin{align} \dot{q}^i~\approx~&\frac{\partial H_{\rm prim}}{\partial p_i}\cr
-\dot{p}_j~\approx~&\frac{\partial H_{\rm prim}}{\partial q^j}\cr
\phi_{\alpha}(p)~\approx~&0.
\end{align} \tag{22}$$
This completes in principle the singular Legendre transformation in the sense that we no longer need to refer to the Lagrangian.
VIII) From this point we assume that there are no explicit time dependence, and we will stop suppressing the $q$-dependence in the notation. We still need to check the consistency condition$^2$
$$\begin{align} 0~\stackrel{?}{\approx}~&\dot{\phi}_{\alpha}~\approx~\{\phi_{\alpha},H_{\rm prim}\}\cr
~\approx~&\{\phi_{\alpha},H_{\rm can}\}+\{\phi_{\alpha},\phi_{\beta}\}w^{\beta}\cr
~=:~&b_{\alpha}+A_{\alpha\beta}w^{\beta} ,\end{align}\tag{23}$$
which is an affine equation in the $w$-variables. If
$$ b~\notin~{\rm ran}(A)~\equiv~{\rm im}(A) \tag{24}$$
(in a weak sense) this lead to secondary constraints in the $(q,p)$-phase space.
Note that (some of) the secondary constraints might not be new.
[This happens e.g. in E&M where the secondary constraint is Gauss' law, which is already there implicitly]. Interestingly, if new secondary constraints (that are not already implicitly present) are needed, this must have a counterpart in the Lagrangian formulation.
Let $\Phi_A$ denote all primary and (new and old) secondary constraint functions, and let $\lambda^A$ denote the corresponding Lagrange multipliers. Let us assume that the Hamiltonian is modified into the form
$$ H(q,p,\lambda)~=~ H_0(q,p)+\lambda^A\Phi_A(q,p).\tag{25} $$
Next repeat the consistency check for the Hamiltonian (25) in search of tertiary constraints, and so forth. The final form of $H$ in eq. (25) is called the total Hamiltonian.
Note that we could in principle shift $\lambda^A\to \lambda^A+c^A(q,p)$ and reparametrize the constraints $\Phi_A(q,p)\to \Lambda_A{}^B(q,p)\Phi_B(q,p),$ where $\Lambda_A{}^B$ is an invertible matrix.
IX) Example with $n=2$ and $r=1$. Let the Lagrangian be
$$ L ~=~\frac{1}{2}\frac{u^2}{1-w}~=~\frac{u^2}{2}\sum_{n=0}^{\infty}w^n, \qquad |w|~<~1. \tag{26}$$
The Hessian
$$ H_{ij}~=~\begin{bmatrix} \frac{1}{1-w} & \frac{u}{(1-w)^2} \\ \frac{u}{(1-w)^2} & \frac{u^2}{(1-w)^3}\end{bmatrix} \tag{27}$$
has two eigenvalues $\frac{1}{1-w}+ \frac{u^2}{(1-w)^3}>0$ and $0$, i.e. it has constant rank $r=1$ when $|w|< 1$.
The first momentum relation
$$ \pi~=~\frac{\partial L}{\partial u}~=~ \frac{u}{1-w} \tag{28}$$
can be inverted to yield
$$ u~=~f(\pi,w)~=~(1-w)\pi. \tag{29}$$
The second momentum relation
$$ \rho~=~\frac{\partial L}{\partial w}~=~ \frac{u^2}{2(1-w)^2}
~=~\frac{1}{2}\pi^2\tag{30}$$
leads to a primary constraint
$$ \phi~:=~ \rho -\frac{1}{2}\pi^2~\approx~0. \tag{31}$$
The canonical Hamiltonian (17) becomes
$$ H_{\rm can}~=~ \pi \left. u\right|_{u=f(\pi,w)} + \underbrace{\frac{1}{2}\pi^2}_{\approx\rho} w
-\left.L\right|_{u=f(\pi,w)}
~=~\frac{1}{2}\pi^2. \tag{32}$$
It is easy to check that there is no secondary constraint. End of example.
References:
M. Henneaux and C. Teitelboim, Quantization of Gauge Systems, (1994), p. 5-7.
D.M. Gitman and I.V. Tyutin, Quantization of fields with constraints, (1990), p. 13-16.
H. Rothe and K. Rothe, Classical and quantum dynamics of constrained Hamiltonian systems, (2010), p. 24-27.
--
$^1$ We will only make a local argument, i.e. ignore global issues.
$^2$ For more details, see my Phys.SE answer here.