In John M. Lee's Introduction to Smooth Manifolds, there is a comment regarding the difficulty of extending the Constant Rank Theorem to the case where the codomain is a smooth manifold with nonempty boundary:
On the other hand, the situation is considerably more complicated for a map whose codomain is a manifold with boundary: since the image of the map could intersect the boundary in unpredictable ways, there is no way to put such a map into a simple canonical form without strong restrictions on the map.
I am curious about what can be said in this case. I can think of a smooth immersion whose image intersects the boundary uncountably many times, for example the map $F: \mathbb{R} \to \mathbb{H}^2$ given by
$$F(t) = \begin{cases}\left(t, e^{-1/t}\right) && t > 0\\ \left(t, 0\right) && t \leq 0\end{cases}$$
However, I don't know if this example violates the conclusions of the Constant Rank Theorem. I originally thought that it didn't, because the smooth charts $\left(\mathbb{R}, \text{id}\right)$ and $\left(\mathbb{H}^2, \psi\right)$ where $$\psi(x, y) = \begin{cases}\left(x, y - e^{-1/x}\right) && x > 0 \\ (x, y) && x \leq 0\end{cases}$$
allow us to represent $F$ in coordinates as $\hat{F}(u) = \left(\psi \circ F \circ \text{id}^{-1}\right)(u) = (u, 0)$ for all $u \in \mathbb{R}$.
But then I realized that $\left(\mathbb{H}^2, \psi\right)$ is not actually a smooth boundary chart, since $(1, 0)$ is mapped to $\left(1, -\frac{1}{e}\right)$ which is not even in $\mathbb{H}^2$.
So I do not know if there are smooth charts with respect to which the coordinate representation of $F$ does have the form $\hat{F}(u) = (u, 0)$, or whether possible counterexamples to the Constant Rank Theorem when applied to codomains with nonempty boundary would require more pathological functions.
Note that this question is similar but not a duplicate because that question is asking for the Constant Rank Theorem with the domain being a smooth manifold with boundary, while my question is about the codomain being a smooth manifold with boundary.