Please note that your proof is somewhat incomplete.
$$\frac{P_y'-0}{P_x'-0}=-\frac{x}{y} \quad \Rightarrow \quad (P_x', P_y')=(-y, x) \, \text{ or } \, (y,-x)$$
is not necessarily true because $(-2y, 2x)$, $(-3y, 3x)$ , ... also satisfy the equation.
Let $P=(a,b)$ and $P'=(a',b')$. According to the definition of rotation around the origin, when a point is rotated around the origin, its distance from the origin remains the same. So we have$$d_{P'O}=d_{PO}$$ $$\Rightarrow \quad \sqrt{(a'-0)^2+(b'-0)^2}=\sqrt{(a-0)^2+(b-0)^2}$$ $$\Rightarrow \quad a'^2+b'^2=a^2+b^2.$$Let $l$ be the line passing through the points $(0,0)$ and $P=(a,b)$, so its equation must be $y=\frac{b}{a}x$. Since the angle of the rotation is $90^{\circ }$, the point $P'=(a', b')$ must lie on the line perpendicular to the line $l$, so the point $P'=(a', b')$ lies on the line $y=-\frac{a}{b}x$ and so $b'=-\frac{a}{b}a'$. So we have$$a'^2+ (-\frac{a}{b}a')^2= a^2+b^2$$ $$\Rightarrow \quad a'=\sqrt{b^2}=\pm b.$$Thus, according to the angle convention, the coordinates of the rotated point $P'$ is$$\begin{cases}P'=(-b, a) & \text{ if the rotation is counterclockwise} \\ P'=(b, -a) & \text{ if the rotation is clockwise} \end{cases}.$$
Addendum
Please note that mathematics conventions are not usually, though depending on the context, formulated mathematically. For example, it is a convention that positive real numbers lie to the right of the origin and negative real numbers lie to the left, and no one defines the "right" and "left" of the origin in terms of mathematical concepts.