When this happen it involves a lot of planning, negotiating with the union, and, when there's enough coverage, a ton of people swinging out over the course of the week so that no one actually does nine shows. Hamilton does this a lot when they have Student performances.
It's not against union rules. The 9th show is paid at double-time, unless the previous/following week has only 7 performances (remembering that the Broadway "week" is Monday-Sunday), in which case it's just paid at the regular rate or an additional 1/8 of salary.
And yes, in most cases everyone in the company DOES do all 9 shows. We don't like it, but it happens.
"What- and quit show business?" - the guy shoveling elephant shit at the circus.