For me the problem was that the uploaded file contained invalid characters (see S3 doc).
Using this sanitizing function solved the issue.
function sanitizeKey(input: string) {
const allowedPattern = /[^a-zA-Z0-9!._*'()-]/g;
return `${input.replace(allowedPattern, '')}`;
}