TOTP "The provider does not support this operation."

I want to reenable TOTP for a user “userx”, but I seem unable.
Current situation:

  ~ ❯ sudo -i -u nextcloud php /var/www/nextcloud/occ twofactorauth:state userx                                                                                              
Two-factor authentication is not enabled for user userx

Disabled providers:
- backup_codes
- totp
- twofactor_nextcloud_notification
  ~ ❯ sudo -i -u nextcloud php /var/www/nextcloud/occ twofactorauth:enable userx totp  
The provider does not support this operation.


TOTP cannot simply be enabled for a user via occ command, as it requires user interaction in the WebUI to set it up (adding the secret to a TOTP app by scanning the QR code or manually copying the secret), i.e. users have to do it themselves.

Also, as far as I know, if you disabled TOTP for a user, you can’t just re-enable it and re-use the same secret, so the user has to set it up again via the WebUI.