What is the local S3 storage that you are using?
Elasticsearch supports S3-compatible repositories, but they need to be fully compatible with AWS S3.
From the docs you have:
Note that some storage systems claim to be S3-compatible without correctly supporting the full S3 API. The
repository-s3plugin requires full compatibility with S3. In particular it must support the same set of API endpoints, return the same errors in case of failures, and offer a consistency model no weaker than S3’s when accessed concurrently by multiple nodes.
One example of an S3 compatible storage that is supported is MinIO.