This is true and follows from a more general fact. Note that in the dimension $n=2$ the unbounded component of $f(\partial\mathbb{D})$ is simply connected.
Theorem. Let $f: \bar{\mathbb{B}}^n \to \mathbb{R}^n$ be a continuous function such that $f|_{\partial\mathbb{B}^n}$ is one-to-one, $f|_{\mathbb{B}^n}$ is a local homeomorphism, and the bounded component of $\mathbb{R}^n\setminus f(\partial\mathbb{B}^n)$ is simply connected. Then $f: \bar{\mathbb{B}}^n \to \mathbb{R}^n$ is a homeomorphism of $\bar{\mathbb{B}}^n$ onto $f(\bar{\mathbb{B}}^n)$.
Remark.
The above result is true even if we do not assume that the bounded component of $\mathbb{R}^n\setminus f(\partial\mathbb{B}^n)$ is simply connected, but the proof requires the theory of Eilenberg-MacLane spaces from algebraic topology, see
Theorem 1.2 in [3].
In the proof we will need the folloiwng lemma [1,2]:
Lemma.
Suppose that $X$ and $Y$ are path-connected Hausdorff spaces, where $Y$ is simply connected. Then a local homeomorphism $f:X\to Y$ is a global homeomorphism if and only if $f$ is a proper map.
(A map is proper if preimages of compact sets are compact.)
Proof of the theorem.
Denote the bounded and the unbounded components of $\mathbb{R}^n\setminus f(\partial\mathbb{B}^n)$ by $D$ and $U$ respectively. According to our assumptions $D$ is simply connected.
Since $f(\bar{\mathbb{B}}^n)$ is compact, it follows that $\partial f(\bar{\mathbb{B}}^n)\subset f(\bar{\mathbb{B}}^n)$. On the other hand $f(\mathbb{B}^n)$ is open (because $f$ is a local homeomorphism in $\mathbb{B}^n)$ and hence $f(\mathbb{B}^n)\cap \partial f(\bar{\mathbb{B}}^n)=\varnothing$, so $\partial f(\bar{\mathbb{B}}^n)\subset f(\partial\mathbb{B}^n)=\partial U=\partial D$.
We claim that $f(\bar{\mathbb{B}}^n)\subset\bar{D}$. Suppose to the contrary that $f(x)\in U$ for some $x\in\bar{\mathbb{B}}^n$. Since $U$ is unbounded and connected, there is a curve connecting $f(x)$ to infinity inside $U$. Since $f(\bar{\mathbb{B}}^n)$ is bounded, the curve must intersect with the boundary of that set and hence a point in $U$ belongs to $\partial f(\bar{\mathbb{B}}^n)$ which is a contradiction, because $\partial f(\bar{\mathbb{B}}^n)\subset \partial U$.
Since $f(\mathbb{B}^n)\subset\bar{D}$ is an open subset of $\mathbb{R}^n$, it follows that $f(\mathbb{B}^n)\subset D$.
We claim that the mapping $f:\mathbb{B}^n\to D$ is proper. Indeed, if $K\subset D$ is compact, then $K$ is a closed subset of $\mathbb{R}^n$, so $f^{-1}(K)\cap\bar{\mathbb{B}}^n$ is closed and hence compact. On the other hand $f^{-1}(K)\cap\partial\mathbb{B}^n=\varnothing$, because $f(\partial\mathbb{B}^n)\cap D=\varnothing$, so $f^{-1}(K)$ is a compact subset of $\mathbb{B}^n$. This proves that $f:\mathbb{B}^n\to D$ is proper. Now the lemma yields that $f:\mathbb{B}^n\to D$ is a homeomorphism onto $D$. That also implies that $f$ is one-to-one on $\bar{\mathbb{B}}^n$ because $f(\partial\mathbb{B}^n)\cap D=\varnothing$. Since $\bar{\mathbb{B}}^n$ is compact, it follows that $f:\bar{\mathbb{B}}^n\to\mathbb{R}^n$ is a homeomorphism onto its image.
[1] Ho, C. W.: When are immersions diffeomorphisms? Canad. Math. Bull. 24 (1981), 491–492.
[2] Ho, C. W.: A note on proper maps. Proc. Amer. Math. Soc. 51 (1975), 237–241
[3] Kauranen, A. Luisto, R. Tengvall, V.:
On proper branched coverings and a question of Vuorinen.
Bull. Lond. Math. Soc. 54(2022), 145–160.