I would like to know for which category/class/set of metric spaces the following holds: for any two metric spaces $X$, $Y$, for any continuous function $f:X\to Y$ there exists a locally Lipschitz continuous function $g:X\to Y$ which is homotopic to $f$.

EDIT: One could also ask a class of metrizable topological spaces such that each one of them can be given a metric so that the above property holds. Actually, I am more interested in the underlying topological space than in the actual metric space.

In general, the metric spaces I am considering are complete and weakly separable (there exists a sequence $(\phi_h)$ of $1$-Lipschitz functions such that for any two point $x,\ y$ $d(x,y)=\sup_h|\phi_h(x)-\phi_h(y)|$).

I don't know if this is a known fact among experts or not; in that case, I apologize for the standard question and would ask only for a reference.

ADDENDUM: Although I also have an interest for the general question as it is posed above, I could try to highlight some classes of metrizable spaces I have particular interest in knowing if they fulfill the request or not: manifolds, singular spaces (which singularities are allowed), spaces which are manifolds outside a "small" (in some sense) set, compact manifolds of infinite dimension or manifolds modeled on some "nice" linear space (Banach, Hilbert, Fréchet, ...).

Thanks.