So it’s not centering horizontally? Wouldn’t that mean it’s not correct? It could just relate to where the origin of your sprites are.
I find it useful to re derive formulas when the result isn’t what I’m after. If the box origin is at the top left, then you can center a 3xN grid of boxes with the following.
Repeat count times
— create box at center.x+(loopindex%3)*box.width-3*box.width/2, center.y+int(loopindex/3)*box.height-int((count-1)/3)*box.height/2
What if the box origins are centered? Then the positions will be off by half the size of the box. Based on your image the origin may be right-center, so just add box.width to the x position to center everything.