What can we say about $(I-AD)^{-1}$ if $D$ is a diagonal matrix?

I have an answer to the following question : Is there a four-variable (not necessarily commutative) polynomial $f$ such that the identity

$$ (I-AD)^{-1}=f((I-A)^{-1},A,D,A^{-1},D^{-1}) \tag{1} $$

holds, whenever $A$ is symmetric positive definite, and $D$ is invertible and diagonal ?

The answer is NO. Indeed, this is already impossible when $n=2$ and $$D=\left(\begin{matrix} 2 & 0 \\ 0 & 3 \end{matrix}\right).$$ If we write

$$ A=\left(\begin{matrix} a & b \\ b & a \end{matrix}\right) $$

with $a\gt 0$ and $a\gt b$, then

$$ \det(A)=a^2-b^2, \det(I-A)=a^2-2a-b^2+1, \det(I-AD)=6a^2-5a-6b^2+1 $$

Thus the RHS in (1) will always have a denominator of the form

$$ (a^2-b^2)^p (a^2-2a-b^2+1)^q, $$

where $p$ and $q$ are integers. Now the LHS in (1) will always a denominator of the form $(6a^2-5a-6b^2+1)^r$. Since we have three distinct irreducible polynomials in ${\mathbb Q}[a,b]$ here, the denominators will never coincide.