Should probably use an “HDRI” EXR. JPGs only have values up to about +2.5 stop, while AgX takes +6.5 stop as “overexposed”. Use False Color and check if the portion of the background that is supposed to be “bright” has any “red” or “white” false color region
There is a hack to do it, by marking the JPG as AgX Base sRGB, then Blender will do an inverse AgX on the JPG. But this is very hacky and it sometimes produces weird values, and things might not look right if you change the view transform etc. I would advice finding a proper EXR from one of those sites like HDRI Haven or something.
Or if you have access to the camera raw file, you can convert that to EXR with software like darktable
JPGs are already formed images, it is the same if you have a light box behind a semi-transparent poster, and try to take another picture at it. You will get… a light box with a poster on it, not the original “scene” as is. That’s just what it is.
Ok, I found the DNG version of the image. I guess I can convert it to EXR in Photoshop. Should I convert it to an 8-bit EXR? What colour space should I pick in the nodes to use the EXR?
8 bit EXR? I didn’t know EXR have 8 bit format. Anyways, I would use at least 16 bit half float. You can use DWAA or DWAB compression if you don’t care about exact precision in numbers.
Make sure they are not clipped though. I am not sure whether PS clips DNG converted EXRs, better check, again, with False Color, whether it get clipped at about +2.5 stop (about orange region in false color)
With DNG converted unclipped EXR, you would still see clippings because of camera sensor dynamic range. But at least it should be higher than +2.5 stop, even phone camera sensors can cover more than that nowadays.
Whatever you encode the EXR itself as. Those EXRs on internet are mostly Linear Rec.709, but you can still encode some other colorspace primaries or transfer function if you like, just make sure you mark it as such in the node’s colorspace option.
EDIT:
An alternative is to composite your 3D render’s formed AgX image with the formed JPG in compsitor. Just make background transparent and manually apply view transform with convert colorspace node, then alpha over. You mentioned your lighting is separate so it seems your original intention was more of a compositing anyways.
Then maybe compositing then. Again it seems that’s what were trying to in the first place. Like making a model mountain and green-screening the background in real shooting.