Using page slug in array

In your tax query, you’re searching for a string instead of a variable, the only time it will match currently is if the term is literally “$page_slug”. You should remove the single quotes around the $page_slug to have it parsed as a variable, so:

'terms' => '$page_slug'

should be:

 'terms' => $page_slug,

error code: 523