Let $\Sigma$ be a compact surface with boundary $\partial \Sigma$. Fix a Riemannian metric on $\Sigma$ and let $D \in \Omega^1(SO(\Sigma),\mathfrak{o}(2) )$ be a principal connection on the associated oriented orthonormal frame bundle $p:SO(T\Sigma) \to \Sigma$. There exists a unique $\Omega \in \Omega^2(\Sigma)$ such that $p^* \Omega = \text{Pf}(\text{Curv}_D)$, the Pfaffian of the curvature form (up to some constant involving $\pi$ which I ignore). Let $\pi_0 : S(T\Sigma) \to \Sigma $ be the unit sphere bundle with $N: \partial \Sigma \to S(T \Sigma)$ the unit normal and let $\Phi \in \Omega^1(S(T\Sigma))$ satisfy $d \Phi = \pi_0^* \Omega$. Then the Chern-Gauss-Bonnet theorem for manifolds with boundary says:
$$ \int_{\partial \Sigma}N^*\Phi = \int_{\Sigma} \Omega - \chi(\Sigma). $$
$T\Sigma$ is a trivial bundle so $SO(T\Sigma)$ is a trivial principal $SO(2)$-bundle so pick the canonical flat connection $A=\theta^L =g^{-1}dg$ on $\Sigma \times SO(2)$ (i.e. the left-invariant Maurer-Cartan form). The curvature of $A$ is $0$ so the Pfaffian of the curvature of $A$ is $0$ hence $\Omega=0$ and $\Phi=0$. Putting this into the Chern-Gauss-Bonnet theorem we conclude $\chi(\Sigma)=0$ which is certainly not true for all $\Sigma$.