$response->status
, $response->query
etc. is not how you set array values in PHP. So you’re just returning that empty array you defined at the beginning. To set a value on an array use square brackets and string for the key:
$response['status'] = true;
Do that everywhere you currently have ->
.
Also, if you can get the tag ID you won’t have to handle the request yourself at all because you could use the REST API and just send a request to:
/wp-json/wp/v2/posts/?tags=39&order=asc&orderby=title
To get posts with, for example, tag 39
in the order you want them. In place of admin_url( 'admin-ajax.php' )
just use rest_url( 'wp/v2/posts' )
and send a GET
request, not POST
.