This is copy comment from reddit quite long time ago.
Not validate it either. But good info to read
Copy from : https://www.reddit.com/r/homeassistant/comments/er3kiv/max_number_of_devices_on_zigbee2mqtt/
Zigbee has a coordinator limit of 32. So only 32 devices can connect directly to any coordinator hub (Conbee2, Smartthings, etc). It is part of the procotol and not something that differs from coordinator hub to coordinator hub. You need repeaters. Zigbee is a mesh system. Imagine a spider web. That web has many connection points to make it strong, repeaters are the connections points. Now think of a spider web with only a few connections. That isn’t going to work well as a web for that spider, eh? Zigbee mesh networks are the same. More repeaters the stronger your network will be. Multiple routes for data to take makes them happy!
Additionally Philips Hue and Ikea bulbs, use ZLL zigbee protocols. Most other zigbee devices use ZHA zigbee protocols. When you have your Hue ZLL trying to repeat your ZHA devices, problems arise. Imagine an Englishman and an American speaking together. Yes they understand most of what is said but some cultural things get lost in translation. The Englishman asks for a lighter for his fag. The American gets insulted over hearing such language so he leaves. So ZHA and ZLL messages get crossed, lost and then device drop because the mesh thinks they are gone since they can’t get messages through. Hey American he meant his cigarette! Most separate their ZLL and ZHA networks by using the Hue/Ikea hub for ZLL and another coordinator for ZHA. Note not all IKEA devices are strict ZLL though. The IKEA outlets and repeaters handle ZHA well! Confused yet?
I see you mentioned Xiaomi. Now Xiaomi are special. They don’t play nice with all zigbee devices. Ikea outlets and Xiaomi play very well together. Since it sounds like you need to strengthen your network with repeaters, Xiaomi love Ikea outlets since they are from the same manufacture. Plus cheap $10 outlets are nice. Peanut plugs, certain models of Sylvania, Smartthings outlets, all do NOT play nice with Xiaomi. For a list of products that work and don’t work well with Xiaomi see here: https://community.hubitat.com/t/xiaomi-aqara-devices-pairing-keeping-them-connected/623
Keep in mind that list is not extensive so if you don’t see your devices on the list then it is just unknown whether is plays nice with Xiaomi devices.
Now you might get your Xiaomi to play nice if they connect through a happy route on your zigbee network and don’t meet an incompatible device in their travels to the coordinator hub. But keep in mind zigbee networks are not static. They change their connections around especially after hub reboots or zigbee network restarts. So you can manage to get your Xiaomi to stay connected for a period of time and then after rebooting experience lots of disconnects.
Last point I have about repeaters, repeaters don’t mean you can add another 32 zigbee devices. Some repeaters only repeat 6-9 devices, some more or some less. So that is why if your building your network, many repeaters are encouraged.
Anyway happy automating!