In most textbooks, the molar specific heat of a gas is defined for gases at constant volume and constant pressure as follows :
$C_v = \frac{Q}{n\Delta T} = \frac{\Delta U}{n \Delta T}$
$C_p = \frac{Q}{n \Delta T}$
But these definitions can also be related by $C_p = C_v + R$, with $R$, being the ideal gas constant.
But it seems that using definition $(1)$ in the first law of thermodynamics leads to contradictions, for example
$$\Delta U = Q - W$$ $$\implies C_v\cdot n \cdot\Delta T = (C_v\cdot n \cdot \Delta T) - W $$
$$\implies W = 0 \ \ (\forall\ C_V, n, \Delta T)$$
Which is obviously not true
Another seeming contradiction can be derived as follows:
$$C_p = C_v + R$$ $$\implies \frac{Q}{n \Delta T} = \frac{Q}{n \Delta T} + R$$ $$\implies R = 0$$
Which again is obviously not true. So it seems one can not just take the definitions of $C_v$ and $C_p$ at face value and use them in equations, there have to be certain conditions where I can or cannot use them.
Textbooks such as Fundamentals of Physics, and University Physics, give very little explanation why the definitions of molar specific heats of gases differ under constant volume and constant pressure, for example why $C_p \neq \frac{Q}{n \Delta T}$, is not explained in much detail if at all in either textbook.
So my question is why do the definitions of molar specific heats of gases differ under constant volume and constant pressure?
And why can I not take the definitions of $C_v$ and $C_p$ at face value and use them in equations?