As it has already been said, if you have a single booking for all the route, if you miss your second flight due to a late arrival of your first one, the airline(s) will have to look for an alternative for you at no cost. Flights from Zürich to Madrid are frequent enough as to be likely to find a non-stop flight alternative on the same day.
If you can book it in a single booking that's because the transit time in Zürich is within the legal limits because otherwise it couldn't be sold to you. If I'm not wrong the minimum legal transit time between flights in Zürich airport is 40 minutes (In Vienna is even shorter, just 25 minutes!!!).
For estimated travel times between gates at Zúrich airport take a look at:
www.swiss.com/ch/EN/fly/airport/zurich-airport#t-page=pane2
Both Air Canada and Swiss are part of Star Alliance and have agreements between them.