When Teams responds with something that is not "1" there is no curl error, so those errors need different handling
Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 413 with ContextId tcid.......etcetera is what you get back when the payload is too large. Why on earth MS choses to respond with 200 OK, instead of using the 413 as http statuscode instead of putting it in the 200 OK body beats me. But showing the error helps debugging
When Teams responds with something that is not "1" there is no curl error, so those errors need different handling
Webhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 413 with ContextId tcid.......etcetera
is what you get back when the payload is too large. Why on earth MS choses to respond with 200 OK, instead of using the 413 as http statuscode instead of putting it in the 200 OK body beats me. But showing the error helps debugging