6. If the polynomial $f(x)=x^{3}-6 x^{2}+a x+a$ has three roots $x_{1}, x_{2}, x_{3}$ that satisfy
$$
\left(x_{1}-3\right)^{3}+\left(x_{2}-3\right)^{3}+\left(x_{3}-3\right)^{3}=0 \text {, }
$$

then the value of the real number $a$ is .. $\qquad$
6. -9 .

From the problem, we have
$$
\begin{array}{l}
g(t)=f(t+3) \\
=(t+3)^{3}-6(t+3)^{2}+a(t+3)+a \\
=t^{3}+3 t^{2}+(a-9) t+4 a-27
\end{array}
$$

The three roots \( t_{1}, t_{2}, t_{3} \) satisfy \( t_{1}^{3}+t_{2}^{3}+t_{3}^{3}=0 \).
By the relationship between roots and coefficients, we get
$$
\begin{array}{l}
\left\{\begin{array}{l}
t_{1}+t_{2}+t_{3}=-3, \\
t_{1} t_{2}+t_{2} t_{3}+t_{3} t_{1}=a-9, \\
t_{1} t_{2} t_{3}=-(4 a-27) .
\end{array}\right. \\
\text { Substituting into } t_{1}^{3}+t_{2}^{3}+t_{3}^{3}-3 t_{1} t_{2} t_{3} \\
=\left(t_{1}+t_{2}+t_{3}\right)\left[\left(t_{1}+t_{2}+t_{3}\right)^{2}-\right. \\
\left.3\left(t_{1} t_{2}+t_{2} t_{3}+t_{3} t_{1}\right)\right],
\end{array}
$$

we get \( 3(4 a-27)=-3[9-3(a-9)] \).
Solving for \( a \), we get \( a=-9 \).