That could be an issue with how Fast-RTPS is being linked. It sounds like it isn’t using RPATH and it should be.
Even without RPATH it should work if ~/ros2-osx/lib
is in your DYLD_LIBRARY_PATH
environment variable after you source ~/ros2-osx/setup.bash
(this is the right one to source in most cases). If it is in the variable, then you may have SIP enabled which is a security feature in macOS that prevents propagation of the DYLD_LIBRARY_PATH
to “system” binaries, like bash and make, which reside in /usr/bin
and similar PATH folders.
If it is SIP then you can disable it (not recommended for security, but will work around the issue):