Are there general position results in singular algebraic sets?

Let $X$ be a real algebraic set, and let $Y \subset X$ be its singular set. In this question I'll focus on the analytic topology, so we can just imagine that $X$ is the zero set, in $\mathbb{R}^n$, of a certain polynomial $f(x_1, \ldots, x_n)$ with real coefficients. It's a classical result that $X$ can be triangulated with $Y$ as a subcomplex. Here is my question:

If $Y$ has codimension $d$ in $X$ (i.e. $X$ has dimension $n$ as a simplicial complex and $Y$ has dimension $n-d$) and $f: M^m\to X$ is a continuous map from a closed manifold of dimension $m\leq d-1$, is $f$ necessarily homotopic, inside $X$, to a map $g: M^m\to X\setminus Y$?

I rather doubt that this is true in full generality. I'd be quite interested in counterexamples (the simpler the better!) or any partial results of this nature.

Note that if $X$ were a smooth manifold and $Y$ were a submanifold, a positive answer to the question is one of the standard consequences of Thom's transversality theorem.

The question could be asked more generally for simplicial complexes $Y\subset X$. In this generality it's clearly false: let $X = Z \vee Z$, where $\pi_1 Z \neq 0$, and let $Y$ be the wedge point. Then $\pi_1 X = \pi_1 Z * \pi_1 Z$ and if $\gamma\in \pi_1 Z$ is non-trivial, every loop representing $\gamma*\gamma$ must pass through the wedge point $Y$. Here's a second question: is there an example of this form in which $X$ is actually a real algebraic set?

Finally, I'll mention that Lemma 2.5 of this paper gives a result somewhat along the lines I'm looking for, but just deals with loops in simplicial complexes (under somewhat strong hypotheses).

-
The lemma you cite has no hypotheses on the dimension of the domain, so it is not about general position. Instead it turns homotopical hypotheses ($\pi_0$) into homotopical conclusions ($\pi_1$). –  Ben Wieland Jun 2 '13 at 23:47
Ben: Yeah, fair enough. Sean Lawton and I were able to generalize the Gomez-Pettet-Souto result to similar sort of statement about $\pi_2$ which seems to serve as a replacement for an honest general position result. I'll edit the question to mention this once I get our draft posted on my webpage. –  Dan Ramras Jun 3 '13 at 1:12

What about $X$ given by the equation $$(x_1^2 + \ldots + x_n^2)(y_1^2 + \ldots + y_n^2) = 0?$$ This is a wedge of $\mathbb{R}^n$ with itself, and $Y = \{0\}$. Then $X-Y$ is disconnected, so the claim is false with $M = S^0$.
If you are not happy with $M$ being disconnected, you can take $M=S^1$ and use the above construction of $X\vee X$ where $X$ is your favorite variety with $\pi_1 X \neq 0$. As you said, there is a loop which will always pass through the origin.
Now I anticipate your question: what about $X$ irreducible in the Zariski topology? Then I don't know and I'm looking forward to see such examples in this thread.
Sorry for being slow, but can you make your second paragraph more explicit? If $X=Z(f(x_1,\ldots,x_n))$ (the zero set of a polynomial $f$ in $n$ variables) and we assume that $0\in X$, then the wedge $X\vee X$ (with $0$ as the basepoint) can be realized as the zero set of the polynomial in $2n$ variables $(f(x_1,\ldots ,x_n)2+y^2_1+\cdots +y^2_n))(f(y_1,\ldots,y_n)^2+x^2_1+\cdots+x^2_n)$. What if $0$ is not in $X$? Then this construction just gives a disjoint union of two copies of $X$ instead of the wedge. Maybe there's some change of variables that fixes this? –  Dan Ramras Jun 2 '13 at 23:34
Sorry, that should say $f(x_1, \ldots, x_n)^2$ not $f(x_1, \ldots, x_n)2$. –  Dan Ramras Jun 2 '13 at 23:35
The complex curve $y^2=x^3-x^2$ is an irreducible curve where a nontrivial element of the fundamental group must pass through the node $(0,0)$. –  Ben Wieland Jun 3 '13 at 0:01