Hello ilia,
Please see the example for the script that sets up the bounding box based on two opposite corners. The example also includes the custom dialog for X1, Y1, Z1 and X2, Y2, Z2 definition, but surely you can specify those values in headless mode with a small modification of the code.
The bounding box center, rotation and size is defined in the internal coordinate system and if you have a georeferenced chunk, the following transformation should be applied to convert the values from that internal coordinate system to geographic/projected:
vector_internal = Metashape.Vector([x, y, z])
vector_geographic = chunk.crs.project(chunk.transform.matrix.mulp(vector_internal))
Applying chunk.transform matrix converts coordinates to geocentric system and then those values have to be projected based on the coordinate system definition.