This is a quite general (and maybe very simple) question about the definition of Gaussian curvature. I have found a lot of "Gauss-Bonnet related questions" (e.g. here) but I didn't find a simple answer to my question.
In John Lee's "Introduction to Riemannian manifolds" (p.250), the Gaussian curvature $K$ of an abstract Riemannian 2-dimensional manifold is defined as $ K = \frac{1}{2} S$, where $S$ is the scalar curvature. This allows to state the Gauss-Bonnet theorem for abstract Riemannian manifolds $(M^2,g)$ without boundary "as usual", that is
$$ \int_M K dM = 2 \pi \chi(M),$$ where $\chi(M)$ is the Euler characteristic of $M$.
The other definition I know for the Gaussian curvature is an extrinsic definition, where $K$ is the determinant of the shape operator (equivalently the product of the principal curvature). This is the definition that appears on wikipedia.
The Theorema Egregium tells us that the two definition coincide when $M$ is embedded in Euclidean space. However, when $M$ is isometrically immersed in another ambiant Riemannian manifold, it seems to me that the two definitions (intrinsic and extrinsic) don't coïncide anymore, since the extrinsic one depends on the geometry of the ambiant space as well (this is exactly what it means to be extrinsic I guess).
So my question is : am I right that these definitions don't coïncide in general, and if yes, is there a reason for which we define the Gaussian curvature of abstract manifolds as half the scalar curvature, other than keeping the "historical" statement of Gauss-Bonnet on abstract manifolds unchanged ?
I find it quite confusing, because I've several times encountered the statement of Gauss-Bonnet on abstract manifolds as above only without defining the Gaussian curvature for abstract manifolds (it is the case on wikipedia for example). Also, I've been trying to prove that $ S = 2K $ for a 2-dimensional manifold immersed in a non flat ambiant space before noticing that the proof I was reading used this as definition for the gaussian curvature instead of the "extrinsic definition".
Maybe I find this confusing because I'm knew to Riemannian geometry, nevertheless it seems to me that it would be less confusing to keep the notion of "Gaussian curvature" as an extrinsically defined notion for immersed manifolds, noticing that when the ambiant space is flat it is in fact intrinsic, and stating Gauss-Bonnet for abstract manifolds instead as $$ \int_M S \, dM = 4 \pi \chi(M). $$