Quasiquotation inside a formula

The place where your function was created (global environment, package namespace, another function's environment) also matters. Symbols pointing to objects in the global environments might resolve properly but they might also be masked by other objects on the way there. enexpr() should almost never be used.