We have run about 20 Ci40s at once before and did have some issues with WiFi channel congestion (perhaps as you would expect). The environment we were in already had lots of 2.4 and 5GHz access points (>10 of each) and adding in 20 more APs and also 20 more clients connecting to those networks created an unstable environment. It's difficult to know how much of this was down to the poor environment we were in, or down to the Ci40's interfering with each other.
Also worth noting that by default the Ci40s all the have the same name for the SoftAP network, which makes using multiple boards as gateways in the same place require some configuration. If you intend to run them all in a gateway configuration then I would expect that manually setting the channels to ensure the best performance will be required.
40 access points in the same place is always likely to cause issues, but it's one of those things where it'll be impossible to know how bad it is until you give it a try. I expect it would be very bad!
If whatever exercise you are attempting to do can be done without the Ci40s being in AP mode, then it becomes much easier, but I assume based on your question that you consider that to be a requirement. If it's not a requirement, you can simply turn it off, and use the boards without each one being an individual WiFi access point (perhaps using Ethernet to connect a device to Ci40 rather than WiFi).