So, if you lose access to the https web GUI, enable http web GUI on the CLI with:
config network webmode enable
Then access the web GUI, go to "Management"and then "HTTP-HTTPS". Press "Delete certificate" and then "Regenerate certificate". Go to the "Commands" page, select "Reboot" and press "Save and reboot". Four minutes later you can access the https web GUI again, and even the WebAuth login page works again.