There is one handy tool on macOS which helps in cases like this one: otool.

otool -L ./ft-test
./fttest:
/usr/local/lib/libfreetype.6.dylib (compatibility version 19.0.0, current version 19.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 495.0.0

The problem was caused by two versions of libfreetype on the macOS. One library was stored in /usr/local/lib and the other was stored in my project directory.