Let us consider first a very particular case. We take $A=B=I$, the identity matrix, and it is enough for our purposes of giving a counterexample to use only $2\times 2$ matrices.
We further take $C,P$ as below and compute $PCP^{-1}$:
$$
C =\begin{bmatrix}3\\& 4 \end{bmatrix}
\ ,\qquad
P =\begin{bmatrix}1 & 1\\& 1 \end{bmatrix}
\ ,\qquad
P^{-1} =\begin{bmatrix}1 & -1\\& 1 \end{bmatrix}
\ ,\\
PCP^{-1}
=
\begin{bmatrix}1 & 1\\& 1 \end{bmatrix}
\begin{bmatrix}3 \\& 4 \end{bmatrix}
\begin{bmatrix}1 & -1\\& 1 \end{bmatrix}
=
\begin{bmatrix}3 & 4\\& 4 \end{bmatrix}
\begin{bmatrix}1 & -1\\& 1 \end{bmatrix}
=
\begin{bmatrix}3 & 1\\& 4 \end{bmatrix}
\ .
$$
This is not a symmetric matrix.
But when does it work? Why does the claim work randomly so good?
The reason is as follows. It works when the diagonal matrix $C$ has equal diagonal entries on two positions when on the same two positions we have equal entries in $D$. For instance, if $D$ has all diagonal entries different, then the condition is automatically satisfied.
So consider $D$ with diagonal entries $d_1,d_2,\dots,d_n$.
Let $C$ have also as a matter of notations the entries $c_1,c_2,\dots,c_n$.
In this case, there always exists a polynomial $f$ such that $f(d_k)=c_k$ for all indices $k$ from one to $n$. Then by matrix functional calculus:
$$
f(AB)
=f(PDP^{-1})
=Pf(D)P^{-1}
=PCP^{-1}
\ .
$$
So we can restate, and want to show that for any polynomial $f$ the matrix $f(AB)B^{-1}$ is symmetric. Such a polynomial is a sum of simple monomials (times coefficients).
So it is enough to show this for $f$ in the list $1,x,x^2,x^3,\dots$.
(The sum of two symmetric matrices is also symmetric, the product of a scalar and a symmetric matrix is also symmetric.)
Well, for the above values we get the matrices:
- $B^{-1}$ for $f=1$,
- $(AB)B^{-1}=A$ for $f=x$,
- $(AB)^2B^{-1}=ABAB\;B^{-1}=ABA$ for $f=x^2$,
- $(AB)^3B^{-1}=ABABAB\;B^{-1}=ABABA$ for $f=x^3$,
and so on, in general we obtain (for the next cases, the first two are somehow special) the matrix $ABA\dots ABA$, and it is easy to check it is symmetric. (A non-commutative palindrome is applied on symmetric matrices.)