Dear Claire,
By default the quantity Detmetricg[] is defined as weighted with respect to the "basis" AIndex, which is a special case for a fiducial abstract basis without doing component calculations. You're already using that correctly in your gLagrangianDensity. There is a separate issue here for your fLagrangianDensity.
Det[] is a plain old Mma function, and xTensor doesn't know what to do with it when doing a perturbation or variation. xTensor only knows about Determinant[metric,basis][], but the argument you have in your fLagrangianDensity is not a metric as far as xTensor is concerned.
We can however do the cofactor expansion of this effective metric, using the epsilon tensor of metricg. This is kind of the brute force way to do it... I'm sure there's a more clever way to do it, where we actually teach xPert and VarD about the determinant of a rank-2 tensor (or possibly even a more general tensor) with respect to a certain basis. That would likely both speed up the calculation and simplify the resulting expressions, by letting us have the abstract quantity Rank2Det[...][] (or whatever you want to call it). This is left as an exercise to an enterprising xTensor user :) For now, please see the attached notebook for the "brute force" way to do it.
Best
Leo