The Einstein-Palatini action can be written as $$ S = M_{pl}^2\int\varepsilon_{abcd}\left(e^a\wedge e^b\wedge R^{cd}\right), $$ where $e^a={e^a}_\mu\text{dx}^\mu$ is the basis one-form and $R^{ab}=\frac{1}{2}{R^{ab}}_{\mu\nu}\text{dx}^\mu\wedge\text{dx}^\nu$ is the Riemann curvature two-form. The Cartan Structure Equations for the torsion-less and metric-compatible connection of GR are $$ R^{ab} = D\omega^{ab} = d\omega^{ab} + {\omega^a}_c \omega^{bc}, \quad 0 = De^a = de^a + {\omega^a}_be^b, $$ where $\omega^{ab}={\omega^{ab}}_\mu\text{dx}^\mu$ is the (antisymmetric) spin connection one-form.
Now, my confusion comes from the fact that if I apply the first structure equation, integrate by parts (neglecting boundary terms), and apply the structure second equation, the whole action seems to vanish. \begin{align} S &= M_{pl}^2\int\varepsilon_{abcd}\left(e^a\wedge e^b\wedge D\omega^{cd}\right) \\ &= M_{pl}^2\int\varepsilon_{abcd}\left(-D(e^a\wedge e^b)\wedge\omega^{cd}\right) \\ &= M_{pl}^2\int\varepsilon_{abcd}\left(-De^a\wedge e^b\wedge\omega^{cd} + e^a\wedge De^b\wedge\omega^{cd}\right) \\ &= M_{pl}^2\int\varepsilon_{abcd}\left(0+0\right)=0 \end{align}
This obviously doesn't seem correct, so is there an error in my understanding somewhere? Is it incorrect to use the structure equations and integrate by parts in the action in this way?