Can't update Homebrew on Catalina

After updating to Catalina (currently 10.15.1), I get the following when attempting to brew update.

% brew update
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
  sudo chown -R $(whoami) /usr/local

When I attempt to sudo chown -R $(whoami) /usr/local as instructed, I get this.

% sudo chown -R $(whoami) /usr/local
chown: /usr/local: Operation not permitted

Any suggestions?

Make it /usr/local/ that’ll work.

Nope. I still get the same error. Operation not permitted.

what does ls -alS /usr and ls -alS /usr/local say?

I ended up doing a clean install of Catalina (backup, reformat, install fresh). While I don’t think this should have required such extreme measures, it does appear to have fixed the issue. I had tried everything I could find online about it with no success.

If all else fails, nuke it from orbit.