A Schengen visa is valid for the whole area. In principle, if you are banned from one Schengen country, you should be banned from the whole area but a visa refusal is not a ban. Conversely, Switzerland can't grant a visa valid only for Switzerland (outside of some very specific cases) but it should decide whether you can be trusted to enter the whole area. Formally, an application to the Swiss consulate is therefore not different from a new application to the German consulate. Each consulate would take previous refusals into account and should decide whether or not to grant a visa based on the same rules.
But don't forget that a visa is granted for a specific trip and purpose. If you applied to Switzerland (and presumably submitted an itinerary, perhaps an invitation, etc.) and show up somewhere else entirely, border guards could become suspicious. If you applied for a Swiss visa specifically with the intent to circumvent the German consulate's decision, you would have committed fraud and could see your visa annulled (or even get a proper ban this time).
And German border guards are certainly empowered to examine all that even if Switzerland issued your visa. They are also likely to be more inquisitive than usual if you show up after several refusals with a visa from another country. So you need to be especially careful to stick to your itinerary and to have all the documentation (tickets, bookings, invitation, anything about the purpose of your trip, your employment, etc.) at hand when crossing the border.
On the other hand, there is nothing automatic about this process. If Switzerland really is your main destination and you merely want to transit at a German airport (thus entering Germany first), it should not be a problem.