I’ve managed to find this problem in the issue tracker, but the ticket UE-15446 (unfortunately looking dead for over a year) seems to describe it as a feature request, while it clearly looks like a bug, because the current behaviour doesn’t seem useful in any capacity. The issue talks about Vertical Box, but the problem is exactly the same for Horizontal.
Just to reiterate on the steps to reproduce:
Put an image in the Horizontal Box, with the image height bigger than box height.
Wrap the image with a Scale Box.
As a result, the image reports properly shrunk width, but the Scale Box has width equal to unscaled image. This makes using those automatic layouts together with Scale Boxes practically useless.
Thank you for the additional information, I will make an internal note on the report that includes a link to this thread. I have also provided a link to the public tracker below for others visiting this thread for better visibility.
Yes this was driving me crazy for many years, but not anymore. No idea when and if it will be merged, but in case you guys are building from source, this is all that is needed to make it behave properly: https://github.com/EpicGames/UnrealEngine/pull/11554