**Bug description** When an AST term is bound to a unification variable, it looses its term index. **Versions** Spoofax version: 2.5.16, nightly april 2022. **Steps to reproduce the behavior** Use a constraint as follows ``` typeOfExp(s, arg) = T :- {ref id} arg == Var2Exp(ref), astId(ref, id), try { false } | note $[Term index: [id]]. ``` **Observed behavior** `id` is a free variable. **Expected behavior** `id` is bound to a particular term index. **Additional context** Originally found by @toinehartman