**Steps to replicate the issue**:
* Set up 2FA using TOTP codes and set up backup codes (I did this some time ago,or WebAuthn using Special:Manage Two-factor authentication (e.g. on on [[https://en.wikipedia.org/wiki/Special:Manage_Two-factor_authentication|enwiki]])
* Navigate to [[ https://en.wikipedia.org/wiki/Special:Manage_Two-factor_authentication | Special:Manage Two-factor authentication ]]On Special:Manage Two-factor authentication, under "Switch to an alternative method", select "Enable" for the method that was not set up
* Under "Switch to an alternative method", select "Enable" for "Web Authentication (WebAuthn)"
* Go through login and enter TOTP code2FA confirmation process
* Confirm switching method (click button)
* Enter name for key and select "Add key"
* Set up key through browser/system dialog* Go through setup process for new method
**What happens?**:
An error message is shown:
> Fatal exception of type "InvalidArgumentException"
{F55881414}
**What should have happened instead?**:
The key2FA method should have been set up and the 2FA methodeen switched to WebAuthn.
**Other information** (browser name/version, screenshots, etc.):
I have tried this (including using different WebAuthn keys) on these platforms:
* Chrome / Chrome OS 126.0.6478.120
* Firefox 127.0.1 on Debian 12.5