I think it’s easiest to use an intermediate expression for this:
via scripting add a Point Control effect to the layer, give its point this expression:
fromCompToSurface([thisComp.width/2,thisComp.height/2,0]);
then read the result of that expression and set it as the new anchorpoint value,
then set the position’s value to [comp.width/2, comp.height/2, 0].
You can then also remove the point control effect