For a solution that does not involve direct constructions using partitions of unity, we can deploy Theorem 1.1 in arXiv:1912.10544, which provides an explicit formula for the classifying space of an ∞-sheaf $F$ (valued in spaces or any algebraic ∞-category) on the site of smooth manifolds.
The classifying space is $$\def\hocolim{\mathop{\rm hocolim}}\def\op{{\rm op}}\def\gs{{\bf Δ}}\def\B{{\sf B}_\smallint}\B F=\hocolim_{n∈Δ^\op}F(\gs^n),$$ where $\gs^n$ denotes $n$-simplex considered as a smooth manifold.
In our case, $F(M)$ can be taken to be the 2-groupoid (more generally: $n$-groupoid) of principal $G$-bundles with connection over $M$. Thus, concordance classes of principal $G$-bundles with connection over $M$ are in bijection with elements of the set $[M,\B F]$.
The ∞-sheaf $F$ admits a forgetful map $F→G$$F→L$, where $G$$L$ is defined in the same way as $F$, but without connection. Thus, concordance classes of principal $G$-bundles over $M$ are in bijection with elements of the set $[M,\B G]$$[M,\B L]$.
The map $F→G$$F→L$ induces a map of classifying spaces $$\B F=\hocolim_{n∈Δ^\op}F(\gs^n)→\B G=\hocolim_{n∈Δ^\op}G(\gs^n),$$$$\B F=\hocolim_{n∈Δ^\op}F(\gs^n)→\B L=\hocolim_{n∈Δ^\op}L(\gs^n).$$
In our case $π_0(L(\gs^n))$ is a singleton set and concordant sections of $L(\gs^n)$ are isomorphic, which can be seen to beand this map is a weak equivalence becauseif and only if for every section $p∈F(S^{n-1})$ whose image in $L(S^{n-1})$ extends along the map $S^{n-1}→D^n$, the section $p$ itself extends along the same map.
This boils down to saying that any principalconnection on the trivial bundle over $G$-bundle$S^{n-1}$ extends to a connection on the trivial bundle over $\gs^n$$D^n$.
For example, if $G$ is trivialan ordinary Lie group, and the space ofthen connections on athe trivial $G$-bundle upare given by Lie algebra-valued differential 1-forms, which do possess the extension property from spheres to concordance is contractibledisks because such differential forms are sections of a certain vector bundle.
Thus Thus, we have a bijection of sets $$[M,\B F]→[M,\B G]$$$$[M,\B F]→[M,\B L]$$ induced by the map $F→G$$F→L$. Hence, any principal $G$-bundle over $M$ admits a connection.
For the case when $G$ is a Lie 2-group, the argument has the same structure, but first one needs to decide on the notion of a connection to use (see Konrad Waldorf's answer), and then see whether the above extension property is satisfied.