I found out why the PX4 SITL wasn’t finding the running Gazebo simulation.
The reason is, when starting the SITL in standalone mode, it looks for the Gazebo service “/world/PX4_GZ_WORLD/scene/info”, where PX4_GZ_WORLD is the world name.
Previously it worked only for the default.sdf because that’s the default world the px4_sitl runs, so I guess it would find it by default, but the variable PX4_GZ_WORLD would be empty.
This all happens in the file located in ${HOME}/PX4-Autopilot/ROMFS/px4fmu_common/init.d-posix/px4-rc.gzsim, lines 67-90.
To fix it then, all we need to do is tell the px4_sitl command the world we want to open.
For the aruco case, that would be ros2 launch ros_gz_sim gz_sim.launch.py gz_args:=aruco.sdf on the first terminal, and PX4_GZ_STANDALONE=1 PX4_GZ_WORLD=aruco make px4_sitl gz_x500_mono_cam_down in another one.