baseUrl outputs environment variable
You can get it to return the url using the siteUrl function and passing it a siteId parameter. So do:

{% set sites = craft.app.sites.getAllSites() | without(currentSite) %}
{% for site in sites %}
   &lt;li&gt;&lt;a href="{{ siteUrl(siteId=site.id) }}" title="{{ site.language }}"&gt;{{ site.language }}&lt;/a&gt;&lt;/li&gt;
{% endfor %}


I don't know if it's the best way but it works :)