Dear Alexey,
I have found what was happening.
Line 241 to 244, there is a condition before copying the Chunk.
If the user do not want to build a dense cloud, then Metashape makes a copy of the chunk with the dense cloud and the depth map.
If the user wants to build a dense cloud, then Metashape does not copy the previously existing dense cloud or dept map.
Or, in my case, I have enough RAM to make the Depth Maps but not enough to filter it and end the dense cloud.
So I update the script like that to force reusing the depth maps :
if not buildDense:
new_chunk = chunk.copy(items=[Metashape.DataSource.DenseCloudData, Metashape.DataSource.DepthMapsData])
else:
new_chunk = chunk.copy(items=[Metashape.DataSource.DepthMapsData])