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→L$, where $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 L]$.
The map $F→L$ induces a map of classifying spaces
$$\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,
and this map is a weak equivalence if 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 connection on the trivial bundle over $S^{n-1}$ extends to a connection on the trivial bundle over $D^n$.
For example, if $G$ is an ordinary Lie group, then connections on the trivial $G$-bundle are given by Lie algebra-valued differential 1-forms, which do possess the extension property from spheres to disks because such differential forms are sections of a certain vector bundle.
Thus, we have a bijection of sets $$[M,\B F]→[M,\B L]$$
induced by the map $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.