The console button is a graphical docker exec. It picks a shell for you, and that does not always exist in the image.
docker exec -it -u root mycontainer /bin/ash
Open the container, click Console, choose the command and the user and press Connect. For Alpine-based images select /bin/ash, because bash is not installed there. For anything else, switch on Use custom command and type your own.
The docker exec line above does the same from the host. Minimal images without any shell cannot be opened this way, and no menu choice will change that.
Further reading: Portainer docs: Access a container's console