HTTP status 422 is apparently unprocessable entity. This suggests to me that Discourse doesn’t like the upload for some reason but it could be something else - I think 422 basically just means “the request was formed correctly but something in the request is wrong”.
Is the image you’re trying to upload an unusual image type or perhaps a gigantic image?
Have you tried including that exact image file in a post?
The avatar (by default) gets resized to a bunch of different sizes so that could be where it’s failing for some reason, e.g. hitting a memory limit if the image is gigantic. That’s mostly speculation though.
I don’t think I would expect to see 422 from S3 and it’s not listed in the error responses on their API reference, so I think the problem is happening in Discourse before it gets as far as trying to upload to S3.