The issue was probably with boto3. As per the suggestion from @jarod, simply updating the package resolved the issue. However, downgrading back to v1.34 also did not result in the issue.