I was able to resolve this issue after a lot of work.
Records in kafka had null values and S3 sink connector cannot write null values to S3 bucket and failed with this error, We were able to dig deeper when we changed the flush.size =1 and then we saw a different error and that made us check for null values.
We developed a patch that fixed the issue. now the S3 connector ignores null values . I dont know why confluent SMT did not work.