I know that if $AXA^*=BXB^*+CXC^*$ for all $X\in M_n(\Bbb{C})$, then $A\in\text{span}\{B,C\}$. For $X$ to be diagonal matrix only, I put $X=e_ie_i^*$ where $\{e_1,\ldots,e_n\}$ is standard orthonormal basis for $\Bbb{C}^n$.
Then $(Ae_i)(Ae_i)^*=(Be_i)(Be_i)^*+(Ce_i)(Ce_i)^*$. This implies $Ae_i=\lambda_i Be_i+\mu_iCe_i$. This may not imply $A\in\text{span}\{B,C\}$. If we know that $\lambda_i$ and $\mu_i$'s are same respectively, then it follows.
Can anyone help me in this regard? Thanks for your help in advance.
No, $A$ does not necessarily lie inside the linear span of $B$ and $C$. Consider $$ A=\operatorname{diag}(1,1,\sqrt{2}), \quad B=\operatorname{diag}(1,0,1), \quad C=\operatorname{diag}(0,1,1). $$ For any $x,y,z\in\mathbb C$, we have $$ A\operatorname{diag}(x,y,z)A^\ast=\operatorname{diag}(x,y,2z)=B\operatorname{diag}(x,y,z)B^\ast+C\operatorname{diag}(x,y,z)C^\ast. $$ However, if $A=\lambda B+\mu C$, we must have $1=a_{11}=\lambda b_{11}+\mu c_{11}=\lambda$ and $1=a_{22}=\lambda b_{22}+\mu c_{22}=\mu$. But then we arrive at the contradiction that $a_{33}=\sqrt{2}\ne 2=\lambda b_{33}+\mu c_{33}$.