Popup seems have no public method which can be used to close the shown popup, there is only a private method _close() which is avaliable for me to close popup without clicking the close button in the right-top corner.
Use map.closePopup();
map.closePopup();
Most helpful comment
Use
map.closePopup();