[guided]The point of this step is to justify the standard Chern-Weil slogan: inside an invariant polynomial, the ordinary exterior derivative may be replaced by the covariant exterior derivative. We must prove this rather than merely state it, because the replacement introduces commutator terms.
We work in the fixed local frame on $U$. The covariant exterior derivative is the operator
\begin{align*}
d_A: \Omega^q(U;\mathfrak{gl}_r(\mathbb{C})) \to \Omega^{q+1}(U;\mathfrak{gl}_r(\mathbb{C}))
\end{align*}
defined by
\begin{align*}
d_A\beta=d\beta+A\wedge\beta-(-1)^q\beta\wedge A.
\end{align*}
For the curvature form $\Omega \in \Omega^2(U;\mathfrak{gl}_r(\mathbb{C}))$, the degree is even, so
\begin{align*}
d_A\Omega=d\Omega+A\wedge\Omega-\Omega\wedge A.
\end{align*}
Equivalently,
\begin{align*}
d\Omega=d_A\Omega-A\wedge\Omega+\Omega\wedge A.
\end{align*}
Now apply the ordinary exterior derivative to the scalar form $\widetilde P(\Omega,\dots,\Omega)$. The form $\widetilde P(\Omega,\dots,\Omega)$ is built by wedging the scalar coefficients coming from the $k$ curvature factors after applying the multilinear map $\widetilde P$ to their matrix parts. Therefore the usual graded Leibniz rule gives
\begin{align*}
d\,\widetilde P(\Omega,\dots,\Omega)=\sum_{j=1}^k \widetilde P(\Omega,\dots,d\Omega,\dots,\Omega).
\end{align*}
There are no alternating signs in this formula because each factor before the differentiated slot has degree $2$, and $(-1)^{2m}=1$ for every integer $m \geq 0$.
Substitute the expression for $d\Omega$ in terms of $d_A\Omega$:
\begin{align*}
d\,\widetilde P(\Omega,\dots,\Omega)=\sum_{j=1}^k \widetilde P(\Omega,\dots,d_A\Omega,\dots,\Omega)+\mathcal C,
\end{align*}
where $\mathcal C$ denotes the total contribution of the terms $-A\wedge\Omega+\Omega\wedge A$ inserted into the $j$-th slot. We now identify $\mathcal C$. Evaluating the resulting form on tangent vectors at a point of $U$, the one-form $A$ supplies a matrix $C \in \mathfrak{gl}_r(\mathbb{C})$, while the curvature factors supply matrices $B_1,\dots,B_k \in \mathfrak{gl}_r(\mathbb{C})$. The two products $A\wedge\Omega$ and $\Omega\wedge A$ insert the two matrix products $CB_j$ and $B_jC$ in the same slot, so their difference is the commutator $[C,B_j]=CB_j-B_jC$. With the sign from $d\Omega=d_A\Omega-A\wedge\Omega+\Omega\wedge A$, the full commutator contribution is
\begin{align*}
-\sum_{j=1}^k \widetilde P(B_1,\dots,[C,B_j],\dots,B_k).
\end{align*}
This is exactly where invariant polynomials enter. Since $P$ is conjugation-invariant, its polarization $\widetilde P$ satisfies the infinitesimal invariance identity
\begin{align*}
\sum_{j=1}^k \widetilde P(B_1,\dots,[C,B_j],\dots,B_k)=0
\end{align*}
for every $C,B_1,\dots,B_k \in \mathfrak{gl}_r(\mathbb{C})$. Hence $\mathcal C=0$, and we obtain the desired covariant Leibniz formula:
\begin{align*}
d\,\widetilde P(\Omega,\dots,\Omega)=\sum_{j=1}^k \widetilde P(\Omega,\dots,d_A\Omega,\dots,\Omega).
\end{align*}[/guided]