Looking at the AWS Lambda documentation, it seems that the error is related to some optimization errore: https://docs.aws.amazon.com/lambda/latest/dg/troubleshooting-invocation.html#troubleshooting-deployment-container-artifact
Error: CodeArtifactUserFailedException error message
Lambda failed to optimize the code. You need to correct the code and upload it again. HTTP response code 409.