At 1000px and above the desktop menu is rendered properly.
At 998px and below the mobile menu (behind hamburger button) is rendered properly.
At exactly 999px the main menu is hidden (as it should), the hamburger button is shown (as it should), but portions of the mobile menu is displayed in the center of the header.
At first I thought it's only one issue with showing / hiding the menu, but looking at it again it seems there are multiple issues, as the menu layout is also not correct. Here is how the mobile menu looks like when it is correctly rendered at 998px:

At 1000px and above the desktop menu is rendered properly.
At 998px and below the mobile menu (behind hamburger button) is rendered properly.
At exactly 999px the main menu is hidden (as it should), the hamburger button is shown (as it should), but portions of the mobile menu is displayed in the center of the header.
At first I thought it's only one issue with showing / hiding the menu, but looking at it again it seems there are multiple issues, as the menu layout is also not correct. Here is how the mobile menu looks like when it is correctly rendered at 998px: