Program works correctly with primusrun, but not with optirun

On my system, I’m having trouble getting the game Stellaris to run correctly using optirun.

The launcher screen appears, but then when I press launch, no loading screen appears on my screen. The process is using 100% CPU, but seems to be running in the background somehow (it also doesn’t appear on the task bar). According to optirun --status, it is using the discrete graphics card.

I came across a thread on the Paradox Interactive forum, where someone said to use primusrun instead, so I tried that. I had to edit the primusrun script a little bit in order for it to get the correct path to the libGL libraries, but then it worked fine!

Btw, the edit I did to the script was this:

export PRIMUS_libGLa=${PRIMUS_libGLa:-'/usr/X11R6/$LIB/'}

Why isn’t optirun working in this case? According to the Bumblebee tutorial I shouldn’t even use primusrun anymore, as the two should be equivalent. Is my optirun configured wrong somehow?