P2 and Argon won't take WiFi credentials

User firmware can prevent setting Wi-Fi credentials from working if it writes to the USB serial port. Putting the device into safe mode (breathing magenta) before going into listening mode, or flashing Tinker before setting credentials can help.

Using the web-based Configure Wi-Fi tool can also help in that case, because it uses control requests, not the USB serial port (CDC).

The error from clearCredentials isn't significant it returns false even on success, also on Argon. See this post

Is the network SSID visible? You must specify the encryption type on the P2 when using the device API to set the credentials for hidden SSID, and also use Device OS 5.7.0 or later. Hidden SSIDs are not supported on Argon.

Is the network available? You can't setCredentials to a network that is not currently visible to the device on the P2 and Argon.