Subscriber/Publisher SitL with Matlab

Hello, I am trying to get Matlab to serve as offboard control to work with PX4 in a SitL loop using Gazebo.

I’m using the tutorial code written by Matlab here as a base: https://www.mathworks.com/help/ros/ug/control-a-simulated-uav-using-ros2-and-px4-bridge.html, with an addition of the MicroXRCEAgent bridge. I’ve also noticed the Matlab code does not set the QoS properly, so that was added, and a pause was added after the subscriber/publisher creation.

Currently, I am successfully receiving messages from subscribers in Matlab, and the topic list clearly shows that Matlab and the gz instance are both connected through ROS2. But nothing I’m publishing in Matlab is showing up in my gz instance, such as the arming command. This is despite the gz instance showing that it is ready for takeoff.

What is also baffling me is that I have some python code taken from another SitL project that has a very similar subscriber/publisher setup, and that publishes just fine to the instance.

Is there any clue as to what is going on or any suggestions what to look at?

(Environment is Ubuntu 22.04, ROS2 Humble).