Microsoft Graph 502 Bad Gateway - Failed to execute backend request when creating a private channel (beta API)

Solution 1:

The problem is that I reached the limit of 30 private channels, even though my private channels are all «deleted», they are still available to restore for 30 days, after what they are permanently deleted. I tested with a new Team and my code is working fine.

It would be nice to have a detailed error, I wouldn't have spent time debugging what is not really a bug.

When trying to create a private channel from Microsoft Teams, I get the error «Your team has reached the maximum number of private channels.». I should have tried this before...

More information here : https://docs.microsoft.com/en-us/microsoftteams/private-channels