The proof is correct. From $\bot$ you can infer anything, which is why the $\psi$ is allowed to "pop out of nowhere" in the first use of RAA in the proof. Note that this use of RAA does not discharge any hypotheses (there is no number next to the line that infers $\psi$ from $\bot$).
In the second use of RAA in the proof, from $\bot$ we discharge hypothesis 2 ($\
eg \phi$) in order to infer $\phi$. Perhaps this is a more normal-looking use of RAA that you are used to (if $\
eg \phi$ yields a contradiction, then infer $\phi$).