Proving the No Retraction Theorem
This is due to the form that the regular value theorem takes for manifolds with boundary:
Let $f:M\to N$ be a smooth map between manifolds with boundary and let $\partial N=\emptyset$. Let $c\in N$ be a regular value for $f$. Then, $f^{-1}(c)$ is a submanifold of $M$ such that $\dim f^{-1}(c)=\dim M-\dim N$ and $\partial f^{-1}(c)= f^{-1}(c)\cap \partial M$.
The conclusion of the Sard's Theorem argument is a bit stronger than what you say.
The real conclusion is that the map $f : M \to \partial M$ has a regular value $r \in \partial M$.
It follows, first, that $f^{-1}(r)$ is a 1-manifold with boundary.
Now suppose that you take $x \in f^{-1}(r) \cap \text{interior}(M)$. The derivative map $D_x f : T_x M \to T_r M$ has rank $1$, so its kernel is a 1-dimensional subspace of $M$. Applying the implicit function theorem, and using that $x$ is in the interior of $M$, it follows that $f^{-1}(r)$ intersected with a small neighborhood of $x$ is a 1-manifold without boundary containing $r$. Thus, $x$ cannot be a boundary point of the 1-manifold $f^{-1}(r)$, therefore all of the boundary points of $f^{-1}(r)$ are contained in $\partial M$.
One can make a still stronger conclusion, namely that $f^{-1}(r)$ is a "properly embedded" submanifold of $M$, which means that each point on $\partial M \cap f^{-1}(r)$ has a neighborhood in which the intersection of that neighborhood with $f^{-1}(r)$ looks like the intersection of the half-disc $\{(x,y) \mid x^2 + y^2 < 0, |y| \ge 1\}$ with the line $x=0$.