Gotcha!
I found it.
Making a lot of possible combinations and activating and deactivating over and over again options of the cache plugin – wp rocket- I have had to exclude this javascript file
/wp-content/themes/generatepress/js/menu.min.js
In this case, I don’t know if it is an error in the cache plugin or if the code could be modified so that it would not be necessary to exclude it.
In any case, it now works, although the loading speed has been reduced in the mobile version in google pagespeed.
Thanks.