Impossible to invoke a method ("url") on a null variable.
{% if associatedArtists is not empty %}
<h2 class="associatedArtist__title">Artistes Associéexs</h2>
<div style="display: flex; flex-direction: column; align-items: flex-start">
{% for associatedArtist in associatedArtists %}
{% set asAr = site.find("artistes").children().listed().findBy('uid', associatedArtist.associated_artist) %}
<a class="badge badge-xl rounded-pill associatedArtist__button" href="{{ asAr.url() }}">{{ asAr.title }}</a>
{% endfor %}
</div>
{% endif %}
</div>
{% if externalArtists is not empty %}
<div class="app-coll-aside__content__down__width">