WP_Query returns wrong post when searching by title?

We should be able to fix the query by doing this instead:

$query = new \WP_Query([
  'post_type' => 'location-data',
  'posts_per_page' => 1,
  'post_status' => 'publish',
  'title' => $title
]);

This is because page is unnecessary and may not be the parameter you actually needed, paged would have been more appropriate, but it too is unnecessary.

Most importantly though, post_title is not a parameter of WP_Query according to the docs, instead it lists title. post_title is only mentioned as a parameter for search columns.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)