Thanks for the answer, there is no syntax error and, again, this abnormal behavior started a couple of weeks ago, without making any changes.
Instead for the button that I had to insert on the page, this executes the same code present in the function onReady(), and so the code is correctly executed.
However I have solved with the button like many other strange situations in the past. Fortunately I don’t pay any subscription so that’s okay.
Thanks again