Best practice would be to wire each player in the rack to the network switch, however, a chain of four should work. If you wire more than one SONOS unit to a Ubiquiti network switch, make sure that the switch is set to STP, not RSTP (the default).
Since one or more SONOS players are wired to your network, the SONOS units will attempt to use their private SonosNet wireless and ignore your WiFi. If your Pub is out of range for SonosNet and you have given WiFi credentials to the Pub unit, it will use the WiFi, however, you could get into an unstable flipflop situation where the Pub unit jumps between WiFi and a weak SonosNet. Some of the Ubiquiti units will allow you to connect the AMP to the Ubiquiti’s network port. In this arrangement AMP will behave as a wired unit and Ubiquiti will handle the WiFi.
Another approach would be to turn OFF the radios in the house rack units -- I assume that there are no other wireless SONOS units in the house.. Here are some considerations. You would want to make sure that the Pub AMP has WiFi credentials while it is wired to the network, then power it down and turn OFF the rack unit radios. Now, the Pub unit will exclusively be WiFi. I’m not very keen on this approach, but it can work. In the future, if you attempt to add another wireless player and have forgotten that you used this little trick, you’ll probably be scratching your head.
Or, you could go full WiFi, by disconnecting all of the SONOS network cables after you have given WiFi credentials.