It's possible that the issue is related to permissions. When you set the visibility to public, you're allowing anyone to access the file. However, you also need to make sure that the IAM user or role that you're using to upload the file has the necessary permissions to write to the bucket.
You can check the IAM policies associated with your user or role to make sure that they have the necessary permissions. You can also try using the AWS CLI to upload the file and see if you get any error messages that might give you more information about the issue.
Here's an example of how you can upload a file to S3 using the AWS CLI:
aws s3 cp /path/to/local/file s3://bucket-name/path/to/remote/file --acl public-read
This command will upload the file to the specified S3 bucket and set the ACL to public-read, which should allow anyone to access the file. If you get an error message, it might give you more information about the issue.
If you're still having trouble, you might want to check the S3 access logs to see if there are any errors or issues with the requests that are being made. You can also try reaching out to AWS support for assistance.