Mail, Automation can't be configured after Time Machine restore after OS re-install ENVIRONMENT: MacPro 4,1, 56GB RAM, running Mojave via DosDude's patch kit.
SYNOPSIS:

I unwisely installed the latest Mojave full update (Mojave Security
Update 2021-002 10.14.6). Afterward, my second monitor did not work
at all (Apple Cinema HD Display on NVIDIA GeForce GT 120 512 MB).
I went back to DosDude's post-install patches, and tried to
re-patch the &quot;Legacy Video Card&quot; patch. Still no joy.
I tried to re-intall the complete DosDude system, but it refused to put an older
system on top of a newer one.
I made sure I had a good Time Machine backup, then wiped the disk, re-intalled the original DosDude system (ticking &quot;Legacy Video Card&quot;) and voila — second monitor worked again!
I then used Migration Assistant.app to try to put things back how they were, using my Time Machine backup.

When the restore finished about 16 hours later, I re-booted and logged in. First thing I discovered is that Mail.app no longer works. It wants to be completely re-configured. When I try to configure gmail, it says Google &quot;didn't authorize&quot; — after successfully going through the linked login procedure!
Then I tried connecting to my local IMAP/SMTP server, using the same credentials that are working on a similarly-configured laptop. It accepts my credentials (after many minutes of thinking about it!), and then asks which apps I want to use with those credentials, including Mail and Notes. No matter how I tick those boxes and click &quot;Done,&quot; it presents me with the same dialogue with an endless &quot;Next&quot; button that apparently doesn't do anything useful.
While digging deeper, I noticed that many of my custom enhancements (Albert, Carabiner, Default Folder, etc.) no longer work. They ask for access to Automation in System Preferences, but then there is no way to change anything. (These were all working before I did the restore.)

My guess is that something in the restore has messed up permissions, ACLs, or attributes for some of the files that System Preferences uses. But /System/Library/PreferencePanes looks exactly like it does on my fully-functioning laptop, running the same OS and patch kit:

Any thought on what I should try next, short of another complete re-install?
Ugh. I never did figure out what went wrong. I re-formatted the disk (always a teeth-clenching experience), and re-installed Mojave from the thumb drive installer I made from the DosDude instructions.
So far, this is the same as before. But this time, when it was done installing and booted up, I used Migration Assistant to restore everything except my home directory, instead of everything.
Then, I logged in, and re-ran Migration Assistant, this time, restoring only my home directory.
Now, things seem to be working normally.