I believe that for any real symmetric matrix $A$, I am always be able to write in the eigen decomposition form
$$A = P\Lambda P^T \tag{1}$$
whatever the rank of $A$. (see Real symmetric matrix is never defective and Real symmetric matrix decomposition).
But for the matrix
$A=$ \begin{bmatrix} 0.375 & 0 & -0.125 & 0 &-0.25 & 0 \\ 0 &0.5 & 0 & -0.25 & 0 & -0.25\\ -0.125 & 0 & 0.375 & 0 & -0.25 & 0\\ 0 & -0.25 & 0 & 0.5 & 0 & -0.25\\ -0.25 & 0 &-0.25 & 0 & 0.5 & 0\\ 0 & -0.25 & 0 & -0.25 & 0 & 0.5\\ \end{bmatrix}
(It is clear that $\det(A)=0$ and $\mathrm{rank}(A)=4$) and the Matlab function [P,D] = eig(A) gives $A=P \Lambda P^{-1}$ but $P$ is not orthogonal, i.e. $P^T \neq P^{-1}$.
where $P=$ \begin{bmatrix} 0.5774 & -0.7071 & -0.4082 & -0.0939 & -0.1850 & -0.0074\\ -0.0000 & -0.0000 & 0.0000 & 0.7945 & -0.5469 & -0.0473\\ 0.5774 & 0.7071 & -0.4082 & -0.0939 & -0.1850 & -0.0074\\ 0 & 0 & 0 & -0.4084 & -0.5469 & -0.6822\\ 0.5774 & 0.0000 & 0.8165 & 0.1878 & -0.1850 & 0.0149\\ 0 & 0 & 0 & -0.3861 & -0.5469 & 0.7294\\ \end{bmatrix}
$D=$ \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0.5 & 0 & 0 & 0 & 0\\ 0 & 0 & 0.75 & 0 & 0 & 0\\ 0 & 0 & 0 & 0.75 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0.75\\ \end{bmatrix}
My question is that Am I misunderstanding the decomposition of real symmetric matrix in (1), or is it a bug of eig() function of Matlab ?
For me it is rather a numerical issue.
The matrix $A$ in your question should have no issue to be diagonalized to the form $A=P DP^T$.
But if we add some numerical error like $$AA=(A(I+AA^T))(I+AA^T)^{-1}=A$$
The
[P,D]=eig(A)and[p,d]=eig(AA)will produce two different answers that only $AA$ satisfies what Matlab claimed, i.e. $AA=p D p^T$.Tested on Matlab R2017a win64.