Question
Let $G$ be some finite group, $H_1, H_2 \leq G$ and $\phi:H_1 \mapsto H_2$ be a group isomorphism. Is it always possible to expand $\phi$ to an automorphism on $G$?
Explicitly, is there an automorphism $\sigma \in Aut_G$ s.t $\sigma \vert _{H_1}=\phi$?
Efforts so far
At first I considered defining $\sigma$ by letting $$\sigma\left(g\right)=\begin{cases} \phi\left(g\right) & g\in H_{1}\\ \phi^{-1}\left(g\right) & g\in H_{2}\\ g & else \end{cases}$$ but obviously such a $\sigma$ is not well-defined for elements in $H_1 \cap H_2$ (other than $e$). I then tried $$\sigma\left(g\right)=\begin{cases} \phi\left(g\right) & g\in H_{1}\setminus H_{2}\\ \phi^{-1}\left(g\right) & g\in H_{2}\setminus H_{1}\\ g & else \end{cases}$$ but then I'm unable to prove injectivity, for example when $x\in H_{1}\setminus H_{2},y\in H_{1}\cap H_{2}$ we get $\sigma\left(x\right)=\phi\left(x\right),\sigma\left(y\right)=y$ so it is unclear why $\sigma\left(x\right)\neq\sigma\left(y\right)$.
Right now I'm questioning the truthfulness of the claim. But perhaps it's just my constructive proof that's wrong?