Is loading EGL with SDL_GL_LoadLibrary undefined behavior?

While troubleshooting an issue in a popular video game I found that if Wayland is available, the game passes the path to the EGL library (e.g. /lib/x86_64-linux-gnu/libEGL.so.1) to SDL_GL_LoadLibrary. This succeeds on the Wayland driver but fails on X11 (which SDL uses instead on some Wayland compositors). Is this something you’re not supposed to do?

Why not SDL_LoadObject()?