How to create a link that uses a route?
The argument has to be a route name.

Try:

$breadcrumbs-&gt;addLink(Link::createFromRoute($term_name, "entity.taxonomy_term.canonical", ["taxonomy_term" =&gt; $tid]));


See the docs for this method.