Interesting -- it looks like this same issue came up in May of '21
Nick and Steve added some code to ensure that context keys are valid strings before doing a lookup, but I suspect calling $env(undefined)
from within a jsonata expression is somehow bypassing those checks.