If one assumes a couple of simple conditions on $f$, namely that the restriction of $z$ on $f(S^2)$ is a Morse function with two critical points and that projections of two halves of $f(S^2)$ ($z>0$, $z<0$) onto the plane $z=0$ realise two original different immersions then $f$ can not be extended to an immersion of the ball. Indeed, assume by contradiction that such an immersion $F:B^3\to \mathbb R^3$ exists. Let $m<0$ be the minimum of $z$ on $f(S^2)$ and $M>0$ be the max. In this case the preimages of planes $z=c$ under $F$ will be $2$-disks in $B^3$ for all $c\in (m,M)$. And by continuity, (changing $c$ from $M$ to 0, or from $m$ to $0$) we will get that the map $F$ applied to disk $F^{-1}(0)$ realised both immersions, which is absurd. One can relax the two conditions by requiring that there is a regular function $z'$ on $\mathbb R^3$ such that $z'=0$ is the plane $z=0$ and $z'$ restricts to $f(S^2)$ as a Morse function with two critical points. If I understand correctly this condition is implicit in your construction of $f$. (one should express what it means that the two halves of $S^2$ realise two different immersions of a disk).