When you click on the category products are loaded with AJAX and JS scroll the page to them. This brings your header transforms to the sticky header that has smaller size and cause this gap. If you want, you can decrease sticky header size in Theme Settings -> Header.