If the error is gone, you will need to re-enable each add-in one at a time to verify which one was responsible for the error. You can also disable all add-ins without going into Safe Mode. Open Outlook in Safe Mode to eliminate all add-ins issues. Have you installed add-ins in your Microsoft Outlook account? One or more of the add-ins may be causing a conflict resulting in the Cannot expand folder error in Outlook. Microsoft notes that you may face performance issues if the limits are breached. Moreover, the number of items per folder cannot exceed 100,000. That limit applies to Microsoft Exchange accounts. If you have more than the specified number of sub-folders, the folder will not expand. Microsoft Outlook has a limit of 1000 folders.
It is not clear how this error persists, but users of Office 2019 seem to be better off. That happens while expanding a shared folder or folder in a second mailbox. Users see a pop-up saying 'Cannot expand the folder' error in Outlook.
It started with Outlook 2010 and users of future versions continue to report it, including Office 365. Microsoft Outlook users have been facing a particular error for the past decade.