The time evolution of a quantum mechanical operator $A$ (without explicit time dependence) is given by the Heisenberg equation
$$ \frac{d}{dt}A = \frac{i}{\hbar} \left[H,A\right] \tag{1}$$
where $H$ is the system's Hamiltonian. The time evolution of the corresponding expectation value is given by the Ehrenfest theorem
$$ \frac{d}{dt}\left\langle A\right\rangle = \frac{i}{\hbar} \left\langle \left[H,A\right]\right\rangle \tag{2} $$
However, as I have noticed, these can yield differential equations of different forms if $\left[H,A\right]$ contains expressions that do not "commute" with taking the expectation value. For example, let
$$\left[H,A\right]=\frac{dA}{df} \tag{3}$$
for some quantum number $f$. The states used for taking the expectation values in (2) clearly depend on $a$. From (1) and (2) the different time evolutions calculated using (3) are
$$ \frac{d}{dt}A = \frac{i}{\hbar}\frac{dA}{df} \tag{4}$$ and $$ \frac{d}{dt}\left\langle A\right\rangle = \frac{i}{\hbar}\left\langle \frac{dA}{df}\right\rangle \tag{5}$$
Note that clearly (5) is not the same as
$$ \frac{d}{dt}\left\langle A\right\rangle = \frac{i}{\hbar}\frac{d\left\langle A\right\rangle}{df}\tag{6}$$
which I would have expected, since then the equations looks equal to (4).
Did I make some mistake? Is this correct? What is the difference between (4)-(6)? Clearly, (4) and (6) give rise to the same solution (one for the operator and one for the expectation value) since the differential equations are the same, while this may not be the case for (5). In fact, from (5) alone, I don't see a clear way on how to construct a solution since $\left\langle A\right\rangle$ does not occur on the right hand side.