I first saw this error when I put SSL in my site. I really haven’t encountered any of this error when I was still just using HTTP and there’s a lot of solution I saw online, but this is the one that works for me and I think would work for other too. The usual error you see is ‘HTTP error’ and that leaves you puzzled on how to fix it. So here’s one of the solution you can try to solve the error.
Now you should be able to upload the image in your WordPress site without issue. If this still don’t work, use everyone’s best friend google to find solution.