It always happen when you have a long economy. The building requires a ware. there is no available ware right now, so the building waits. A new ware is produced, and it gets sent to the building immediately. Nice! Too bad such ware is on the opposite side of the map, and will take 30 minutes to arrive. In the meanwhile, the building will not get any wares because it's waiting the one on the road. happens a few times, screws you up completely.
there are a couple of ways to manage that. Both of them require having a surplus of all significant wares.
1) Divide your land in different areas, each devoted to one single ware. Here are bakeries, breweries and everything else using up grain. there are the metal smelters and everything else using up ores, and so on. Put a warehouse in each of those areas, and set it as preferred place of storage ffor the wares that are processed there. That way, all the grain will go to the grain warehouse, and every time a bakery will need grain it will get it from the warehouse, which is close. that grain takes 30 minutes to reach the warehouse, but that's not a problem.
The downside of this approach is that you have to plan it from start. You cannot make buildings as you expand. you must leave space in the early game planning to eventually fill it, or you must dismantle a lot of buildings.
2) split the economy in several smaller economies. they are still connected by road, but when you decide you are settling a new area as a neew production center, you are going to build there farms, wells, bakeries, taverns, metal smelters, weaponsmiths, a barracks, arena, training camp, everything, and a warehouse in the middle of it. you can only skip production of building material, because you won't need them continuously. And each one of those smaller economies must have a surplus of wares. that way every time a building needs a ware, it will find it in a warehouse close by. travel between different zones is kept to a minimum, but you still need damn good roads. that's the way I prefer.
One year ago einstein hosted a challenge to make the greatest economy on nile map in 24 hours. you really fill the whole map in that time. maybe there are screenshots availlable (any replay will be impossible to open by now, they lose version compatibility fast) so you could see how the map should look like. I managed to make more than 3000 fully promoted soldiers in that time, and worldsavior bested me by a few dozens.