Hi @MikeFinch87 Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
Based on the error message it looks like the error message is originating from the retry logic. You may refer to the code sample from CustomRetryPolicy which uses an approach of using the retry policy fully, rather than wrap another retry policy around method calls.
I appreciate it if you can share the modifications made you have made to the DeviceReconnectSample class to help us better understand the potential cause of this issue.
Also, it looks like you are trying to use certificates through the sample. I would like to check with you and see if you have reviewed the article Provision an X.509 certificate simulated device. This provides the steps needed to provision a device using certificates. Kindly review this and see if this addresses your testing needs without having to modify the code.
Please let us know if you have any additional questions or need further assistance.
If the response helped, please do click Accept Answer and Yes for the answer provided. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.