The function is not symmetric about the $x$-axis. It is symmetric about the $y$-axis; that is to say, $f(x) = x^2 \cos 3x$ satisfies $f(-x) = f(x)$ for all $x \in \mathbb R$.
With the choice $u = x^2$, $du = 2x \, dx$, $dv = \cos 3x \, dx$, $v = \frac{1}{3} \sin 3x$, we get $$\int x^2 \cos 3x \, dx = \frac{x^2}{3} \sin 3x - \frac{2}{3} \int x \sin 3x \, dx.$$ Repeating the process with the choice $u = x$, $du = dx$, $dv = \sin 3x \, dx$, $v = -\frac{1}{3}\cos 3x$, we get $$\int x^2 \cos 3x \, dx = \frac{x^2}{3} \sin 3x - \frac{2}{3} \left( -\frac{x}{3} \cos 3x + \frac{1}{3} \int \cos 3x \, dx \right).$$ From this we conclude the indefinite integral equals $$\frac{x^2}{3} \sin 3x + \frac{2x}{9} \cos 3x - \frac{2}{27} \sin 3x + C.$$ Evaluating this at the endpoint $x = \pi$ gives $-2\pi/9$, whereas evaluating at $x = 0$ gives $0$, hence half the definite integral (due to the aforementioned symmetry) is $-2\pi/9$, and the full value is $-4\pi/9$, as you claimed.