Using Chrome's inspector tool to create the example here. On my website I have the default font size set to 14px, which causes a 1px gap between search and the nav. I did 10px as an extreme example
Changing page zoom won't cause this, since it'll scale everything on the page down, not just the font size
With the way the elements here are laid out, significantly the avatar, if the font-size is reduced, you'll also need to shrink the avatar size too. It's that which is adding the extra height to the account section which isn't also added to the search section.