Thanks, the problem seems to be solved or at least I am able to replicate it and see when it happens. I have reset the button and have been able to assign actions to it. They all work fine.
The problem appears when I assign a static IP address to the device. After I save the static setting, the device flashes and it becomes unreachable. Any further action has no effect and I have to reset the button.
I assigned a static IP because the app recommends to do so but if it works without this I can easily leave it as is. Static IPs are more useful for the other Shelly devices towards which I send the commands from the button