I asked the following question on StackExchange but received no response:

Let $M$ be a smooth $n$-dimensional compact manifold with boundary. Let $U$ be an open neighborhood of $\partial M$. Assume that we have a fixed immersion $\bar f : U \to \mathbb{R}^{2n-1}$. Can we always find an immersion $f : M \to \mathbb{R}^{2n-1}$ such that $f |_{\partial M} = \bar f |_{\partial M}$?

I believe this should work in $\mathbb{R}^{2n}$. Since $\bar f$ is an immersion, $d\bar f$ is a bundle monomorphism $TU \to U \times \mathbb{R}^{2n}$ covering $\bar f$. We can think of this as a section of the associated bundle over $U$ whose fibers are the Stiefel manifold $V_{n}(\mathbb{R}^{2n})$. Since $\pi_{n-1}\left(V_{n}(\mathbb{R}^{2n})\right) = 0$, we can extend the section from $\partial M$ to $M$. Now we can apply Smale-Hirsch to get the desired immersion $f : M \to \mathbb{R}^{2n}$.

Does the statement hold in $\mathbb{R}^{2n-1}$?

EDIT: To incorporate Oscar's comment, let's assume that we can perturb $\bar f$, if necessary. We can also assume that $U$ is connected.