Let us define a group $G =\langle a,b \mid a^p =e, b^p=e, ba=a^2b \rangle $ where $p$ is a prime. It can be deduced that $o(G) = p^2$. The subgroup $N$ generated by the element $a$ is of the order $p$ and is normal in $G$ because $bab^{-1} =a^2 $.
We know that if $N$ is a normal subgroup with $o(N)=p$ of the group $G$ with $o(G)=p^2$, then it must be that $N \subset Z(G)$ shown here. But in that case $ab=ba$ and $ba = a^2b$ imply $a=e$ which is not true.
What is causing the contradiction ?
I assume that one can define a group with generators and relations, where the relation can be any set. Is this correct ?
Edit : Let the group be defined as given. Without using the fact that $ N \subset Z(G)$ when $o(N)=p$ and $o(G)=p^2$, prove that $a=e$.
The proof you give is essentially correct, except every time you say something has order $x$, you should say it has order at most $x$, or even order dividing $x$.
A corrected proof goes as follows: the subgroup generated by $a$ is normal, and it has order dividing $p$. The quotient has order dividing $p$ as well, so the whole group has order dividing $p^2$. It follows that $G$ is abelian (I'm guessing $p$ is meant to be a prime, judging by your link, although I think we can still make things work even if $p$ is not a prime), from which we conclude that $a$ is the identity. The whole presentation then collapses to $G=\langle b|b^p=e\rangle$, so $G$ has order $p$.