First of all, airlines to their utmost best to ensure that they do not have passengers who need visa but do not have them.
If an airline notice you do not have a needed visa before you enter the plane, they might not transport you at all, or if it is because the travel is re-routed, they might re-route you again, so you are not in the plane.
But if a plane is rerouted and lands at an unexpected airport the situation will depend on the airport and its facilities. And it depends on the country the airport is in, as some countries have a more strict set of rules than other countries.
If an airport has an air-side area that stays open overnight, with or without a hotel, the passenger is likely to be confined to that area or that hotel.
If there is no air-side place, or if the country is happy to allow more freedom of movement, often the passenger without the visa is given a temporary visa for that day, often with a location restriction that might keep the passenger from leaving the airports city, and a limited time that would be enough for a flight the next day.
I have heard of people who got a series of these visa, one day at a time till the weather changed enough for flights to leave.
In some (extreme) cases those passengers who do not have visa are held in a small area, with only the minimum comforts, sometimes a real prison cell, other times a room otherwise used for interviews. There they will get food and drinks and (if staying overnight) can get some sleep. If the people without a visa are hold like this, they will be escorted whenever they need to leave this area. (Sometimes for bathroom use already, other times only when arriving and leaving.)
I do not know what you will get in Zurich but an air-side hotel is available and I would not be surprised if you do get the option to stay overnight there, or spend a long daytime layover.
If it is seen as likely that you need to stay longer in Zurich than your visa situation allows, you may be re-routed by the airline or even be re-routed via other airlines so you will not have to have a layover or long layover in a country where you (would) need visa.
In any case, when you travel on a single ticket and have the right visa when you come to the first airport, the airline will make sure you can continue your journey, to the original destination country, (and if possible the same airport,) for which you do have visa.
No sources, this is what I have learned over the years. (Aided by the comments on the question.)