Let your age be $x$. If the age difference is $\Delta x$, in $\Delta x$ years our ages will sum to 63, so we have $2x+\Delta x = 63$, which is to say $\Delta x = 63-2x$.
We also know that $\Delta x$ years ago you were twice my age, so $x-\Delta x = 2(x-2\Delta x)$ or $3\Delta x = x$.
$$3\cdot 63 -6x = x$$ $$\implies x = 27$$
$$\implies \Delta x = 63-54 = 9$$
$$\implies\boxed{\text{You are 27, I am 18}}$$
So there seems to be a miscalculation by your teacher. (Obviously the reasoning is instructive but just to confirm, $9$ years ago you were $18$ and I was $9$, hence satisfying the first statement, and in $9$ years you will be $36$ and I will be $27$ meaning our ages will indeed sum to $63$)