_variables: Fix reporting of missing variable
Description
When the missing variable was not defined, we would get an exception as a string doesn't contain provenance information.
This was broken during the yaml refactor
Changes proposed in this merge request:
- Fix provenance reporting for missing variables
- Add a test to prevent regression