Query by pagename not Working

I try and fail.
What could be the problem with the following code:

The post exists and the variable “$ pagename” is placed approximately.
But the query does not receive a post.