Cannot Delete Mailboxes in Mail.app

I had the exact same problem with a mailbox restored via Time Machine.

What worked for me was quitting Mail.app, deleting the mailbox from ~/Library/Mail/V6/long-string/, opening Mail.app, and deleting the offending mailbox one more time.