In Differential Topology the usual strategy to discuss homotopy classes by differential means is approximation, because a manifold $M$ is a euclidean neigborhood retract (ENR) and any good approximation of a map $f:X\to M$ is homotopic to $f$. Now, consider the following situation where this does not work: a pair of manifolds $Z\subset Y$, $Z$ not closed in $Y$; more precisely, suppose that $M=Y\setminus Z$ is not locally compact, hence not a ENR and we cannot guarantee approximation implies homotopy (as far as I know). The question is to exhibit an explicit counterexample: a continuous map $f:X\to M$ which is not homotopic to its smooth close approximations.
To give some concrete example, suppose $Y=\mathbb R^4$, $\dim(Z)=1$ to have enough room for manipulations. We recall $Z$ is not closed in $\mathbb R^4$, even more, $M=\mathbb R^4\setminus Z$ is not locally compact. The typical transversality attempt to show $M=Y\setminus Z$ is simply connected would be as follows:
(1) Every continuous loop $f:\mathbb S^1\to M$ can be arbitrarily approximated by a smooth loop $g:\mathbb S^1\to\mathbb R^4$ transversal to $Z$ (note the codomain of $g$ is not $M$), and since cod$(Z)\ge2$ transversality means $g$ does not meet $Z$ and so actually $g:\mathbb S^1\to M$.
(2) Now, $g$ is nulhomotopic by the smooth homotopy $H_t=(1-t)g+ta$ for any fixed $a\notin Z$. Again, we can approximate $H$ by a new smooth homotopy $\widetilde H$ transversal to $Z$, and since $H_0=f$ and $H_1\equiv a$ are already transversal to $Z$ (they do not meet $Z$!), we can preserve $\widetilde{H_0}=H_0$ and $\widetilde{H_1}=H_1$. Finally since cod$(Z)\ge3$, transversality means $\widetilde H$ does not meet $Z$, and so $\widetilde H$ is a homotopy in $M$, and $g$ is nullhomotopic in $M$.
Summing up, $f$ is arbitrarily close to $g$ and $g$ is nulhomotopic, but we cannot conclude $f$ is nulhomotopic, because approximation does not imply homotopy. Hence a more concrete version of my question above: there is a smooth curve $Z$ not closed in $\mathbb R^4$ whose complement is not simply connected?