Modifying textures/setting backgrounds in Isaac Sim

Hi all,

I am having trouble assigning textures to prims in Isaac Sim. In the in-built script editor, the following snippet sets the texture parameter of a DomeLight for me successfully:

import omni.kit.commands
from pxr import Sdf
    
omni.kit.commands.execute('CreatePrim',
        prim_type='DomeLight',
        attributes={'intensity': 1000, 'texture:format': 'latlong'})

omni.kit.commands.execute('ChangeProperty',
        prop_path=Sdf.Path('/World/DomeLight.texture:file'),
        value=Sdf.AssetPath('omniverse://localhost/Users/admin/strawberry/DR/backgrounds/evening_meadow_4k.hdr'),
        prev=None)

Interestingly, this does not work when called through running python.sh. The code runs without errors, but the texture does not show up on images acquired by a script similar to python_samples/syntheticdata/basic/visualize_groundtruth.py.

Has anyone achieved texture modification for domain randomization? If so, whats the catch?