I upgraded from Mohave to Big Sur and found that homebrew is not working any more. I installed the command line tools using the command
xcode-select --install
I had the same problem. Try upgrading brew - this solved it for me.
brew upgrade