This is an interesting business idea for those that like to bake. Some issues that would come into play is local zoning laws for using your home to bake. There are also other issues that would make this business difficult to start. Many restaurants and diners will be concerned about how clean your baking facilities are and local laws may require inspections if they allow it at all. This business may be best in small towns or rural areas in states that have fewer zoning laws. Check your local laws. Another issue is the cost of ingredients and other costs like gas and other utilities to bake and transportation costs to bring the baked items to your customers. The costs will add up fast but the price you can get for your product would have to be closer to wholesale for the restaurant or diner to resell at a profit.
A specialty of yours that may be baked at lower cost may be best. For example, you may be able to use local produce or your own produced fruit that is abundant because it is in season at a low price. If you live were apples are grown, apple desserts, cakes and pies would make sense if you get the fruit cheap when it is in large supply. You may even grow some fruit, vegetable or nuts on your land, so that your main ingredient is very cheap or almost no cost. The cost advantage would be unique to you.
It's possible you would be able to use the facilities of those that you are baking for but that may make you an employee so you need to look at the laws. You may occasionally use their facilities as a baking specialist or baking chef to over see your special baking creations. Always know the laws of what is possible and avoid issues that may be a problem for you and your customers.
This idea of baking for restaurants and diners business is best for someone that has a unique advantage for it and not everyone. It's best for someone that has a good and known reputation for baking. Cost and other problems and issues may be more than it's worth. It takes time to bake and desserts also have limited time of freshness. The profit margin may be slim with costs high. It's good for those that can bake something that is low cost but you will still have to deal with the other issues that make it difficult to run a baking business.