If you log into your iCloud account in your browser, do you see the missing folders? Check they still contain messages? If yes, I would uncheck iCloud Mail in System Preferences > Internet Accounts.
You might need to also delete the folder in V3 that contains your data. Deleting the account does not delete the messages.
User's Library/Mail/V3