Solution
First of all try reinstalling the packages again:
brew tap microsoft/msodbcsql https://github.com/Microsoft/homebrew-mssql-release
ACCEPT_EULA=y brew reinstall --no-sandbox msodbcsql mssql-tools
Then if it's still happening, run:
cp -v "$(brew list msodbcsql | grep odbcinst.ini$)" ~/.odbcinst.ini
to copy the INI file which defines the location of SQL ODBC driver.
Bug report: SQL Server : Can't open lib 'ODBC Driver 13 for SQL Server'.
Then test your SQL setup by: sqlcmd -S localhost or isql -v -k <connection-string>.
See: Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS.
Debugging
$ odbcinst -j # Verify the config.
$ sleep 20 && sqlcmd -S localhost & # Run `sqlcmd` in the background.
$ sudo fs_usage -f filesys | grep -w sqlcmd | grep -e open -e access -e stat64
open /Users/myuser/.odbcinst.ini
access /usr/local/lib/ODBC Driver 13 for SQL Server
access /lib>>>>>>>>>>>>>>>>>>>>
access /usr/lib/ODBC Driver 13 for SQL Server
stat64 ODBC Driver 13 for SQL Server
stat64 /opt/X11/lib/ODBC Driver 13 for SQL Server
stat64 /usr/lib/ODBC Driver 13 for SQL Server
For Linux, see this Anaconda related issue: ODBC Driver 13 for SQL Server can't open lib.