In my case it was because the filename was containing spaces. Solved it thanks to this documentation (which is unrelated to the problem):
from urllib.parse import unquote_plus
key_name = unquote_plus(event['Records'][0]['s3']['object']['key'])
You also need to upload urllib as a layer with corresponding version (if your lambda is Python 3.7 you have to package urllib in a python 3.7 environment).
The reason is that AWS transform ' ' into '+' (why...) which is really problematic...