Actually, a simpler code worked for me. I just added the null position to the parent position…
For the X,Y transorm position of the 3D stroke…
controller = thisComp.layer("Null Layer");
controllerPos = controller.position;
parPos = controller.parent.position;
x = controllerPos[0] + parPos[0];
y = controllerPos[1] + parPos[1];
[x,y];
And for the Z transform position of the 3D stroke…
controller = thisComp.layer("Null Layer");
controllerPos = controller.position;
parPos = controller.parent.position;
controllerPos[2] + parPos[2];