I'm using the C# SDK to connect to Azure IoTHub in testing. I'm using the C#SDK symmetric keys and DPS. I've modified DeviceReconnectionSample to work with SymmetricKeySample/ProvisioningDeviceClientSample. Sometimes it works, and sometimes I get this. Note that the connection to DPS works the first time, so I have the correct certificate, and then fails on retry.
09/15/2023 18:51:05> Information - Using Mqtt_WebSocket_Only transport.
09/15/2023 18:51:05> Debug - Attempting to initialize the client instance, current status=Disconnected
09/15/2023 18:51:05> Information - Initialized for registration Id