InvalidArgumentException: Invalid translation language (fr) specified
Should check on lang_code the variable you already passed from preprocess, not language.getId() try something like that:

{% if lang_code == 'fr' and tab_label.entity.hastranslation(lang_code) %}
  &lt;li class="tab"&gt;{{ tab_label.entity.translation(lang_code).field_tab_title.entity.label }}&lt;/li&gt;
{% else %}
  &lt;li class="tab"&gt;{{ tab_label.entity.field_tab_title.entity.label }}&lt;/li&gt;
{% endif %}