Flat connections on 3-manifold with boundary
Another good reference is Chris Herald's paper. Legendrian cobordism and Chern-Simons theory on 3-manifolds with boundary. Comm. Anal. Geom. 2 (1994), no. 3, 337–413.
It is an easy exercise with Poincare duality to see that the image of the map in cohomology (so at the level of "Zaraski" tangent spaces) $$ H^1(Y;ad_\rho) \to H^1(\Sigma;ad_\rho) $$ is half dimensional. Indeed this map appears in the long exact sequence of the pair $(Y,\Sigma)$ $$ H^1(Y;ad_\rho) \to H^1(\Sigma;ad_\rho)\to H^2(Y, \Sigma;ad_\rho) $$ and the two arrows are dual by PD so have the same rank. The exactness tells you the sum of these ranks is $dim(H^1(\Sigma;ad_\rho))$.
Here $\rho$ is a representation of $\pi_1(Y)\to G$ corresponding to the given flat connection and $ad_\rho$ is the local system with fiber $\mathfrak{g}$ corresponding to the adjoint action of $\rho$ on $\mathfrak{g}$.
For the case of compact $G$, see Proposition 3.27 in: Freed, Daniel S. Classical Chern-Simons theory. I. Adv. Math. 113 (1995), no. 2, 237–303.
For the case of complex reductive $G$, see Theorem 61 in: Sikora, Adam S. Character varieties. Trans. Amer. Math. Soc. 364 (2012), no. 10, 5173–5208.