I noticed this after drupal 9 update, but I've tried to find the exact moment when it was broken and I couldn't find it. I use S3 and cloudfront for images so maybe the problem is related with that config.
Apparently, the images work well (that's why I didn't realize it was broken). Images load correctly in my frontend and even the little preview in the backend is correctly shown. The problem is the link to the original file.
For instance, as you can see, the twitter image is working correctly (it's been shown in the backend) but if I follow the "twitter.jpg" link above the image, it sends me to:
<a href="/https%3A//test-web-development.s3.eu-west-1.amazonaws.com/s3fs-public/2022-01/twitter.jpg" type="image/jpeg">twitter.jpg</a>
The big problem is it's adding a "/" before the image link itself and instead of just using the url itself. On top of that, it's writing a "url-safe" so the "https://" is transformed into "htttps%3A//".
According to debug, it's using this template and I don't see anything strange in it (I tried a different theme too, but still failed):
<!-- BEGIN OUTPUT from 'core/themes/claro/templates/field/file-link.html.twig' -->
Any idea on what can be causing this?