Dynamics with error term

How do the dynamics of a system change when an error term is introduced? For instance, if I have a system (computed torque control - robot manipulator):

$$M\ddot{q} + C\dot{q} + G = u$$ and $$e = q-q_{ref}$$, where $$q_{ref}$$ is a time varying reference, how would this system be rewritten in terms of the error $$e$$?

I was thinking it would be:

$$M\ddot{e} + C\dot{e} + G = u$$

but then I would be missing terms $$-M\ddot{q_{ref}}$$ and $$-C\dot{q_{ref}}$$ correct?

I am confused on how tracking errors manifest in the system equation.