I am not a Mac expert but am hoping that Barry will weigh in on this. In the meantime:
One reason for failed enumeration is lack of bandwidth. If the devices use interrrupt or isochronous transfers and attempt to reserve more bandwidth than is available, some devices won't enumerate. However, the fact that you can enumerate all of the devices on an Android host suggests it's probably not that.
Yes, each USB keyboard and mouse, which may be hard-wired, is a USB device, as is each physical hub. In fact, one physical hub might contain multiple hub devices. However, the theoretical maximum number of devices on a bus is 127, and if bandwidth isn't a problem, I would expect a host to be able to enumerate 30-40 attached devices.
A protocol analyzer might give more detail about where and why the enumeration is failing.
Is the limit always 20 even if you change the device types?
Have you tried tiering the hubs for example, using a tier of 5 hubs with each hub except the last connecting to 6 devices and a downstream hub? (The last hub will connect to the last 4 devices of the 28.) Even if that is not feasible for what you need to do, it could offer a clue.