I actually solved it myself. I observed the menu was not working only on the pages that aren’t created by elementor. So, I opened all the pages with elementor editor and updated them.
Now it’s working fine.
Actually, after testing it even more, I found that it’s not that it only works once. It’s that it only works on selected pages (home page and cart page).