One of the main concerns of bakery and other perishable items is the short shelf life of products. Thats why their supply chain management and demand prediction usually had to be spot on. But no matter how much effort you put, there will be wastage. No matter how much calculation and over calculation you do, you can never predict exactly how much pastries will be sold everyday.
The point to be noted is not that pastries will be wasted. The point is what will you do with the extra pastries that remains after the end of the day.
You can always sell it the next day. Few, if any, would understand the difference. But for a long term quality / brand building purpose, this is the least favorable option.
Then of course, you can always give it to charity. Not only give it to charity, communicate that you give it to charity. This will not inly assure the customers that you are not selling stale food. But also, it creates a very favorable disposition about your shop in the mind of the customers.
And at the end of the day, thats all that matters.