After debugging a large chunk of code, I could identify this MWE.
association = <|"x"-> <|"key01"-> "ok"|>|>[var];
If I evaluate:
I get an error evaluating the last test["x"]. What is very strange, I expected to find an error just in the evaluation of test["y"].
The same error does not occur if we change from Block to Module. In the Block case, we have some sort of unexpected scope leak.
Looks like a bug in Lookup.
Tested in Mathematica version 11.3Cross post in Stack Exchange