Dear Paulo -> Thanks! Now the code looks much smarter and clearer.
Dear Alexey -> Thanks!
Additionally i made some changes for my code.
Again an updated code from my side. But still errors...
I believe it is a copy chunk, a saving or a loading problem.
When i open the agisoft project i have now only two chunks: "Chunk 1" and "Copy of Chunk 1"
Do you have suggestions how to solve this issue?
The rest of the code should work fine

Here are the error lines.
2023-05-03 12:53:30 2 images blended in 2.535 sec
2023-05-03 12:53:32 loaded partition in 0.343 sec
2023-05-03 12:53:32 boundaries extracted in 0.022 sec
2023-05-03 12:53:33 1 images blended in 0.831 sec
2023-05-03 12:53:33 orthomosaic updated in 36.331 sec
2023-05-03 12:53:33 Updating orthomosaic...
2023-05-03 12:53:34 orthomosaic updated in 0.461 sec
2023-05-03 12:53:34 Finished processing in 528.392 sec (exit code 1)
2023-05-03 12:53:34 SaveProject: path = XXXXXXXXXXX
2023-05-03 12:53:34 Saving project...
2023-05-03 12:53:34 saved project in 0.169 sec
2023-05-03 12:53:34 Finished processing in 0.175 sec (exit code 1)
2023-05-03 12:53:34 DuplicateChunk: items = (keypoints, depth maps, point cloud, model, DEM, orthomosaic, tiled model)
2023-05-03 12:53:35 Duplicating chunk...
2023-05-03 12:53:35 Error processing model: 'Metashape.PointCloud' object has no attribute 'points'
2023-05-03 12:54:03 Finished processing in 28.943 sec (exit code 1)
2023-05-03 12:54:03 DuplicateChunk: items = (keypoints, depth maps, point cloud, model, DEM, orthomosaic, tiled model)
2023-05-03 12:54:04 Duplicating chunk...
2023-05-03 12:54:04 Error performing gradual selection1: 'Metashape.PointCloud' object has no attribute 'points'
2023-05-03 12:54:32 Finished processing in 28.676 sec (exit code 1)
2023-05-03 12:54:32 DuplicateChunk: items = (keypoints, depth maps, point cloud, model, DEM, orthomosaic, tiled model)
2023-05-03 12:54:32 Duplicating chunk...
2023-05-03 12:54:32 Error performing gradual selection2: 'Metashape.PointCloud' object has no attribute 'points'
2023-05-03 12:55:01 Finished processing in 28.373 sec (exit code 1)
2023-05-03 12:55:01 ExportReport: path = XXXXXXXXXXXXXXXXX
2023-05-03 12:55:01 Generating report...
2023-05-03 12:55:01 Error writing statistics: 'Metashape.PointCloud' object has no attribute 'points'
2023-05-03 12:55:07 Analyzing chunk...
2023-05-03 12:55:08 Found 4 GPUs in 0.004 sec (CUDA: 0.002 sec, OpenCL: 0.002 sec)
2023-05-03 12:55:08 Finished processing in 7.411 sec (exit code 1)
2023-05-03 12:55:08 ExportPointCloud: path = XXXXXXXXXXXXX
2023-05-03 12:55:08 Saving point cloud...
2023-05-03 12:55:08 point cloud size: 114973886 points
2023-05-03 12:56:28 Finished processing in 79.578 sec (exit code 1)
2023-05-03 12:56:28 Error exporting results: Invalid argument name: pixel_size
2023-05-03 12:56:28 Processing completed successfully.
2023-05-03 12:58:50 LoadProject: path = XXXXXXXXXXXXX
2023-05-03 12:58:50 Loading project...
2023-05-03 12:58:51 loaded project in 0.836 sec
2023-05-03 12:58:51 Finished processing in 0.837 sec (exit code 1)