Hello wojtek,
You may need to add datatype assignment to the sensor:
DATATYPES = {"U8": Metashape.DataType8u, "U16": Metashape.DataType16u, "U32": Metashape.DataType32u, "F16": Metashape.DataType16f, "F32": Metashape.DataType32f, "F64": Metashape.DataType64f}
sensor = camera.sensor
sensor.bands = ['' for i in range(photo.image().cn)]
dt = photo.image().data_type
if dt in DATATYPES.keys():
sensor.data_type = DATATYPES[dt]