This is by design. The gameplay systems prioritizes that output piles at production buildings are empty over shorter walk distances to ensure that the economy is always running smoothly.
Is this also valid for charcoal mines for instance? I have placed a charcoal storage next to the smith since the charcoal mines are very far away. Will the charcoal also be delivered from the mines over the entire map instead of from the storage which is next door? That would feel wrong.
In the end, it is way more complicated. The resource broker that decides which carrier transports which commodity from which source location to which target has a lot of parameters that influence the decision. In your example for huge distance differences it may chose the storage over the production building. For smaller differences in distance it prefers the production building.