dylib load order matters, but why?

After disabled several plugins, I successfully built the arm64 UE5 editor on Mac m1. However, it fails to load the OnlineSubsystemUtils plugin. It turns out that although UnrealEditor-OnlineSubsystemUtils.dylib is linked against UnrealEditor-OnlineSubsystem.dylib, it must be explicitly loaded first to be loaded successfully. If UnrealEditor-OnlineSubsystem.dylib is loaded first, which is the normal case of the engine initialization, then dlopen UnrealEditor-OnlineSubsystemUtils.dylib will fail and the errno is 2, aka No such file or directory. A simple dlopen program as below confirmed that.

// file: dlopen.c
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <dlfcn.h>

int main(int argc, char *argv[], char *envp[]) {
for(int ndx=1; ndx<argc; ++ndx) {
printf(“Loading %s…”, argv[ndx]);
void *p = dlopen(argv[ndx], RTLD_LAZY|RTLD_LOCAL);
if(p) {
printf(“loaded.\n”);
p = dlopen(argv[ndx], RTLD_NOW|RTLD_LOCAL);
if(p) {
printf(“fully loaded now.\n”);
dlclose(p);
} else {
fflush(stdout);
perror(“cannot fully load”);
}
} else {
fflush(stdout);
perror(“failed”);
return errno;
}
}
return 0;
}
So I temporarily fixed it by specifically dlopen UnrealEditor-OnlineSubsystemUtils.dylib on program start. And I’m still walking through codes of these two plugins too figure out what caused that. Any idea or suggestion?