Great questions but they creates false and unrelated dichotomies. I'll explain more fully in a bit.
Quite a bit.
But first: I'm not giving you "legal advice." I'm probably not licensed to practice in your jurisdiction and am certainly unfamiliar with the applicable statutes and regulations whatever they are. I'm only discussing widespread customs in a very general way. When you're ready for serious legal advice, you should scam a relative into giving thousands of bucks worth to you for free.
That out of the way, one problem with answering your questions is trying to figure out what you're trying to do.
If you're going to prepare pastries and desserts in your client's kitchen, to be consumed on your client's premises, then the laws regulating commercial kitchens aren't applicable. In essence, you're an employee of the client and most liability goes to the client. That's generally what caterers who cook in the client's kitchen are doing -- catering a party to be held at the client's home. I.e., from a regulatory standpoint they work as "personal chef's," or "kitchen help." The insurance/legal liability question is more complicated and depends on the type of contract relationship, who has the deepest pockets, nature of the caterer's business form if any, etc.
Returning to the "commercial kitchen" question: If you're preparing food to be sold to anyone other than the owner and/or operator of the kitchen in which it's prepared you are subject to all the regulations governing the commercial preparation of food.
Here are a few hypothetical examples:
If you want to bake six pies at Wendy Darling's house, 2 for Wendy's party, 2 for kindly, old Dr. Smith's retirement across town; and 2 to be auctioned at the School for Scandal's bake sale -- you can't unless Wendy's kitchen complies with commercial standards.
If you want to bake six pies at Wendy's house for the Darling's party -- no problem about the commercial kitchen. You're providing a service, not retailing a "good." From an insurance and/or legal standpoint, if someone gets sick it can get complicated. You and/or Wendy might both be liable -- depending largely on coverage, depth of pockets, and actual causation. As to other possibilities, if you fall down, you sue Joan; if you burn her house down, her insurance company sues you; if you've created a business form such as a corporation or LLP, the fall and burn answers get complicated.
The nature of your business suggests you want to bake at Joan's home kitchen in order to sell pies to kindly, old Dr. Smith. In most municipalities, that would make you a food retailer preparing food in a non-compliant kitchen and would be a big problem if and when you got caught. From an insurance tandpoint it would not lessen your liability, but it would put Joan at risk. From a legal standpoint, in terms of your own liability you would have put yourself in a "negligence per se" situation by violating applicable regulations -- which as a practical matter means that if you get sued you've pretty much lost before you get started. As to the pies you donated to School for Scandal bake sale, that depends whether you donated them as an individual or a catering business.
You probably have more questions. In the meantime, I hope this helped,