Reading the official documentation for AVCapturePhotoOutput I found this:
The AVCapturePhotoOutput class implicitly supports wide-gamut color photography. If the source AVCaptureDevice object’s activeColorSpace value is P3_D65, the capture output produces photos with wide color information (unless your AVCapturePhotoSettings object specifies an output format that does not support wide color).
And also this for activeColorSpace:
By default, a capture session automatically enables wide-gamut capture for supported devices and capture workflows...
So maybe your device supports it by default and that's why in the output you see the image with different colors. Try changing the activeColorSpace
and see if that makes a difference.