Yet another way, $z=0$ is not a solution, and multiplying by $\bar z \ne 0$ gives:
$$|z|^2 \,\bar z + 3 i \,|z|^2 \,=\, (p + 9i) \,\bar z \quad\iff\quad 3 i \,|z|^2 = (p + 9i - |z|^2) \,\bar z$$
Taking complex conjugates on both sides:
$$- 3 i |z|^2 = (p - 9i - |z|^2) \, z$$
Multiplying with $\,3 i \,z \,=\, p + 9i - |z|^2\,$ from the original equation and canceling $\,z\ne0\,$:
$$
\require{cancel}
9\,\cancel{z}\,|z|^2 = (p - 9i - |z|^2)(p + 9i - |z|^2)\,\cancel{z} \quad\iff\quad |z|^4 - (2p + 9)\,|z|^2 + p^2+ 81 = 0
$$
For a unique solution the discriminant of the quadratic must be zero:
$$
0 = (2p+9)^2 - 4(p^2+81) = \cancel{4p^2}+36p+81-\cancel{4p^2}-324= 9(4p-27) \;\implies\; p = \frac{27}{4}
$$
It follows that $\,|z|^2 = \dfrac{2p+9}{2}\Big|_{\,p\,=\,27/4} = \dfrac{45}{4}\,$, then from the original equation:
$$
3 i \,z \,=\, p + 9i - |z|^2 = \frac{27}{4} + 9 i - \frac{45}{4}=\frac{9}{2}(-1+2i) \quad\implies\quad z = \frac{3}{2}(2+i)
$$