I apologize for the late reply.
After trying multiple things to solve the issue, I tried to use the firmware updater to update the SSL certificates. Apparently, the cloud updated their certificate and this caused the issue. Once updated, the code worked perfectly as it used to.
Thank you PieterP for your help ![]()