Is this normal? Variables bug

This:

works fine,
but this:

doesn’t work.

Oddly, this:

works.

Did I miss something in variables behaviour or is this a bug?
Pretty sure it’s not supposed to behave like this.