Using debug.log I can see that the center of mass is updating correctly but it seems that it’s always just slightly off center. And if it’s rotated for a long time, it will get worse.
I did notice in the console that the center of mas was being updated to one decimal point. I thought maybe for more accuracy, I would need at least a couple more.
I don’t know whether there’s a way to increase precision, but you’re obviously getting a cumulative error because of it. You could try storing the original center of mass and always adding the calculated value to that, instead.
Are you sure that this is the best approach for keeping something rotated in the centre of screen? If you provide a quick vid or animated gif of the scenario, I might be able to suggest a cleaner approach.