Nix is just way more reliable than Homebrew, because it does not use system tools, but rather builds the dependencies by itself (including, for example, a C compiler).
Furthermore, dependencies will not be overwritten if a different package requires the same dependency, but another version of it, so packages don’t break each other.