Is_front_page inside header.php is always returning true

Yes it should work in the header file just like normal. Try using a standard IF statement instead of shorthand:

if( is_front_page() ){
    echo 'Front page!';
}

You must have it configured in the settings to use:

A static page (select below) instead of Your latest posts

If you want is_front_page() to only return TRUE when viewing the page you select from the dropdown for Front Page (which it sounds like you do)

You can then use is_home() if a static page is set for the front page of the site, this function will return true only on the page you set as the “Posts page”.

https://developer.wordpress.org/reference/functions/is_home/

Whether is_home() or is_front_page() return true or false depends on the values of certain option values:

  • get_option( 'show_on_front' ): returns either 'posts' or 'page'
  • get_option( 'page_on_front' ): returns the ID of the static page assigned to the front page
  • get_option( 'page_for_posts' ): returns the ID of the static page assigned to the blog posts index (posts page)

When using these query conditionals:

  • If 'posts' == get_option( 'show_on_front' ):
    • On the site front page:
      • is_front_page() will return true
      • is_home() will return true
    • If assigned, WordPress ignores the pages assigned to display the site front page or the blog posts index
  • If 'page' == get_option( 'show_on_front' ):
    • On the page assigned to display the site front page:
      • is_front_page() will return true
      • is_home() will return false
    • On the page assigned to display the blog posts index:
      • is_front_page() will return false
      • is_home() will return true