Interestingly, adding a dummy redundant pvget beforehand fixes the issue for the duration of the script:
pvget -p ca -w 0.5 -t ${BL}:CS:TL:RemExp:En 2>/dev/null
remexp_enabled=$(pvget -p ca -w 0.5 -t ${BL}:CS:TL:RemExp:En 2>/dev/null)
However, when similar dummy pvget is run before executing the script, the issue gets resolves completely.
Weird.
The easy explanation would be that pvget (or any library it uses) is changing the environment in a way that avoids the failure later on. Sounds unlikely, though.
Comparing environment dumps could rule that out.
~Ralph