Solution 1:

Consider the following linear map on the Hilbert space $l^2(\mathbb{N})$. Define $T : l^2 \to l^2$ by $ T((x_1,x_2,....)) = (0,x_1,x_2,...)$.

Clearly $T$ is an isometry, but not onto.

Solution 2:

In mathematics, an isometry is a distance-preserving injective map between metric spaces.
(Ref: https://en.wikipedia.org/wiki/Isometry)

Now the argument that you are giving is flawed because $d_X(x, x_1)$ is well defined the moment you gave the metric $d_X(,)$. The isometry respects the metrics in $X$ and $Y$ through the relation $$d_Y(f(a), f(b))=d_X(a,b)\text{ }\forall\text{ } a,b\in X$$ and it does not define the metric $d_Y(,)$.