OCIO Isssue in Nuke terminal mode or batch mode

I’m launching Nuke in terminal mode and passing it a python script to run. This script sets up OCIO colorspace with a custom ocio.config file and saves the script at a location. Then I render an mov file from the same terminal session. But the render I’m getting is not what it should be.

Then I open that script, which I saved during my terminal session, in Nuke GUI mode and render it again. This time colors looks good. I’m kind of confused if nuke is buggy in terminal mode

The culprit is not render vs. gui but using a python script on the command line i think. See https://support.foundry.com/hc/en-us/articles/115000080464?flash_digest=350cc8fbfe442a4842c98db8975bfee9b12c4a9f&input_string=ocio-settings+when+running+nuke+with+any+python-script