WordPress | Convert #038; to &

You’re setting the link using PHP-generated JavaScript. I’m sure there are better ways to do this, e.g. just write the onclick handler into the div, or use an <a> tag for a link as usual, but if you want to it this way you should be using esc_js() not esc_url().

<script type="text/javascript">
document.getElementById("professionista<?= $query->post->ID ?>").setAttribute(
  'onclick', 'location.href = "<?php echo esc_js( get_permalink($query->post->ID).$url ); ?>"');
</script>

As also discussed in the comments you should probably also be using add_query_arg() to append the &s= part to your URL, rather than just string concatenation. That would also handle the urlescape-ing the value part of $url if you’re not doing that already, and would cope with the case where your permalink doesn’t contain a ? already which it looks like you’re assuming.