typecode-libmagic-system-provided assumes that homebrew installs libraries in /opt/homebrew..
On my system, the libraries are installed in /usr/local.
Extend the search of possible locations to include /usr/local (in the same way as the search for locating the library on freebsd).