This is not a Mojo but a Homebrew issue. To fix it, edit your .zprofile
with nano inside the terminal with
nano ~/.zprofile
.
There should be exactly one line related to Homebrew that reads
eval "$(/opt/homebrew/bin/brew shellenv)"
Remove all duplicate lines. If you've added Homebrew to your PATH manually, you don't even need that one line. Try to comment it out and restart the terminal to check if that is the case.
See this GitHub issue for further information.