Loosing colors after Color Correction/calibration, the image turns into grayscale

Hi all,

Just trying to do color correction, as described here

Here is some image properties:

Color representation: sRGB
Width: 3456
Height: 4608
Hor. resolution: 72dpi
Ver. resolution: 72dpi
Bit depth: 24
Resolution unit: 2

EXIF version: 0220
All goes well, but after writing the image to disk, I am getting grayscaled image.
What I am missing?

The source code contains
cvtColor(img_out, out_img, COLOR_RGB2BGR);

but in fact, image is sRBG
Is this the reason?

show code & example image, please