Hello htk,
The order of input bands in PhotoScan (B1, B2, B3...) for MicaSense RedEdge and Parrot Sequoia cameras is selected according to the central wavelength information from the image meta data.
For such cases you can use this workaround similar to yours:
order = {"Blue": "B5", "Green": "B3", "Red": "B2", "NIR": "B4", "Rededge": "B1"}
for sensor in chunk.sensors:
chunk.raster_transform.formula = order[sensor.bands[0]]
chunk.exportOrthomosaic(project_path + project_name + "_" + sensor.bands[0] + ".tif", image_format=PhotoScan.ImageFormatTIFF,
format=PhotoScan.RasterFormatTiles, raster_transform=PhotoScan.RasterTransformValue,
write_kml=False, write_world=True, tiff_overviews=False, write_alpha=True, progress=progress)