The priest has an intention regarding what is and isn’t to be consecrated. So, for example, if I have a ciborium of hosts that I’ve left on the credence table as they’re “surplus to requirements”, I have no intention to consecrate them. In the same way, if the altar servers forgot to bring them over, then they remain unconsecrated since I can’t say I had an intention to consecrate them along with the other hosts. Typically, priests will have in mind an intention to consecrate everything in front of them (which may or may or may not be the same as everything on the corporal).
The whole bakery / wine cellar question is one of those things that gets bounced around with no definitive answer mainly because, just as with absolution, consecration is the work of God and not man! A good argument can be made that the priest who attempts to consecrates the whole bakery or wine cellar (presumably not both at the same time!) doesn’t intend to do what the Church does (so doesn’t have the mind of the Church) because of the absolute prohibition in Canon Law of consecrating the eucharistic species separate from each other and of consecrating either (or both) outside of mass. Of course, that said, priests can and have violated this canon (for example finding themselves a few hosts short on communion rounds) but there’s still something of an argument to be made there. Besides this, not everything in the bakery (or wine cellar) would be licit (or even valid) matter for the Eucharist - it would be odd to have an intention only to consecrate valid matter without any attempt at separating it out first. Finally, it could also be argued that such an act is so crazy that it’s doubtful the priest is capable of forming the requisite intention. Again though, all this is speculative and basically we trust that Our Lord is capable of protecting his Church (and himself) from such things!