RawTherapee’s profile RT_Medium_gsRGB is the equivalent of Adobe RGB but it does not exactly match the profile embedded in
To make sure we’re using the same Adobe RGB profile (yes they can differ, sRGB profiles can differ a lot from each other as well) I extracted the profile from
exiftool -icc_profile -b -w icc Dia_4850_HDR_withICC.tif
and I saved it as
You’re opening two identical images in PSE, except one has a profile assigned and the other does not, then you’re saving them both “as” Adobe RGB which I guess means that you assign the Adobe RGB profile to them. Identical pixel values in, identical pixel values out, both get the Adobe RGB profile assigned, they both match.
When you open
Dia_4850_HDR_noICC.tif in RawTherapee, the “Use embedded, if possible” input profile option finds no input profile and falls back to assuming that your image is in the sRGB colorspace. If you set
ADBE.icc in RT as both the input profile and the output profile, then the saved result perfectly matches the files saved by PSE.