Avoid relative names in type checking messages

This also simplifies the error message by not showing the full query. Only the offending expression is shown.

Tests are passing, but I'm not sure if the removal of the query makes the message less usable/specific in some edge cases.