AWS upload screenshot crash

This has been driving me nuts. I am trying to take a screenshot and upload it to an AWS bucket using the AWS CLI for mac.

Here's the terminal command that I eventually want to run:

aws s3 cp {filepath} s3://mybucket | echo https://mybucket/{filename} | pbcopy

Which should upload to s3, and copy the outputted bucket url

I notice that even when I simplify the command to just:

aws s3 cp {filepath} s3://mybucket

It still crashes, so i thought maybe it has something to do with not running the aws cli under the correct user account?

All my commands work perfectly outside of BTT, here are some screenshots

BTT 3.402
MacOS 10.15.5