I understand most of your email messages stored locally, in Mailboxes you created "On My Mac" disappeared. That would certainly be disturbing.
Do the Mailboxes themselves still exist, but their contents are missing? If so try selecting the affected Mailbox(es) and then choose the Mailbox menu > Rebuild.
If that does not work, as long as you used Time Machine to back up your Mac, then you can select the affected Mailbox, and "Enter Time Machine" to restore the affected Mailbox. A message will appear prompting you to click Restore to recover the selected Mailbox from Time Machine.