Proof that a continuous map to $S^n$ whose image is a proper subset of $S^n$ is null-homotopic
Not all proper subsets of $S^n$ are contractible (unless $n = 0$ obviously). Take any two unequal points $x \neq y \in S^n$, then $\{x,y\} \subset S^n$ is not contractible.
What is true is that $S^n \setminus \{ x \} \cong \mathbb{R}^n$ is contractible, so if the map isn't surjective, it factors through a contractible space so it's nullhomotopic.