This might happen because it takes time for the gazebo px4 simulation to compile at first run. After running this demo again it works.