The key in the metadata
object is the base64 encoded string of the value. Since you are replacing the value, you would have to replace the base64 version of it too.
Based on the snippet you shared, though you have updated the value in the metadata
object, the action is still listing files in the folder that you were testing (which I assume are none).