As picture below, I think the $B(X,Y)$ depengs on the extension of $X,Y$.Obviously, $\overline X -\overline X_1=0$ on $M$ doesn't mean $\overline \nabla_{\overline X -\overline X_1}\overline Y=0$, because $\overline\nabla$ is connection on $\overline M$ , not only on $M$. So, I can't understand the below.
It's from do Carmo's Riemannian Geometry.

We have the following lemma
$Lemma :-$ If $\nabla$ is a connection on $TM$ and $p\in M$, then $\nabla_XY\mid_p$ depends only on the value of $X$ at $p$.
Now since $\bar{X}-\bar{X_1}$ vanishes on $M$, so we can look at the expression $\bar{\nabla}_{\bar{X}-\bar{X_1}}\bar{Y}$ pointwise, and that only depends on the points of $M$, so the latter expression vanishes.