Here are the four equations being discussed here:
\begin{align}
v &= u + at \tag{1} \\
x &= ut + \frac{at^2}{2} \tag{2} \\
v^2 - u^2 &= 2ax \tag{3} \\
x &= vt- \frac{at^2}{2} \tag{4}
\end{align}
Is this derivation correct?
The result is always correct. The derivation is correct, except for dividing by $(v - u)$. It is possible that this is zero, ie $v = u$ (equivalent to $t = 0$ or $a = 0$ by equation $(1)$). If $t = 0$, then $x = 0$, so Equation $(4)$ is still correct. And if $a = 0$, then Equation $(4)$ clearly follows from Equation $(2)$, so Equation $(4)$ is still correct.
And why is this wrong to say that this is the fourth equation of motion?
It is not wrong. It is a matter of opinion which equations should be collected together and referred to as standard equations of motion; opinions cannot be right or wrong. And this equation is actually a standard equation of motion, so in that sense, it was actually your teacher who was wrong. We will come back to this.
First, let us look at whether it is useful.
Notice that your derivation only used Equations $(1)$ and $(3)$. Unfortunately, to cover the $a = 0$ case, we were forced to use Equation $(2)$ as well. Equation $(1)$ does not have $x$ at all, and Equation $(3)$ says nothing about $x$ when $a = 0$.
So we need Equation $(2)$. But can we drop Equations $(1)$ or $(3)$, so we are back to using only two equations? Yes:
\begin{align}
x &= ut + \frac{at^2}{2} \\
&= (v - at)t + \frac{at^2}{2} \\
&= vt - at^2 + \frac{at^2}{2} \\
&= vt - \frac{at^2}{2}
\end{align}
We used Equations $(1)$ and $(2)$, but not Equation $(3)$. Actually, this makes sense. Given a constant $a$ and explicit formulas for $x$ and $v$, we should be able to derive all other equations. In fact, we can derive Equation $(3)$ from Equations $(1)$ and $(2)$:
\begin{align}
v^2 - u^2 &= (u + at)^2 - u^2 \\
&= u^2 + 2u(at) + (at)^2 - u^2 \\
&= (2u + at)(at) \\
&= 2a \left( ut + \frac{at^2}{2} \right) \\
&= 2ax
\end{align}
So it would appear that Equation $(4)$ is not that useful – but only if we accept that Equation $(3)$ is not useful either.
But there is another way of looking at it. There are five standard quantities: $t$, $x$, $u$, $v$ and $a$. Equation $(1)$ includes every quantity except $x$. Equation $(2)$ includes every quantity except $v$. Equation $(3)$ includes every quantity except $t$. Equation $(4)$ includes every quantity except $u$. There should be an equation that includes every quantity except $a$:
\begin{align}
x &= ut + a\frac{t^2}{2} \\
&= ut + \frac{v - u}{t} \cdot \frac{t^2}{2} \\
&= ut + (v - u)\frac{t}{2} \\
&= ut + \frac{vt}{2} - \frac{ut}{2} \\
&= \frac{ut}{2} + \frac{vt}{2} \\
&= \frac{(u + v)}{2}t \tag{5}
\end{align}
(And there is that divide-by-zero trap again. But if $t = 0$, then $x = 0$, so Equation $(5)$ is still correct.)
When you look at it this way, you can see the all five equations could be useful. When you replace $x$ with $s$, these become the so-called “SUVAT” equations that some other users have mentioned. All of these are standard equations, as mentioned above.