“convert to sRGB” in interface overwrites "includeProfile" in extendscript

Hi everyone. I noticed that in Photoshop, if you have the “convert to sRGB” enable inside the export/save for web, it overwrites my exportOptionsSaveForWeb object. So if I set exportOptionsSaveForWeb.includeProfile the export will be in sRGB even if the project is in Display P3.
If I disable the “convert to sRGB” in save for web the export will include Display P3.
Am I doing something wrong or is this a photoshop bug?