Error while arming cube orange plus using ros2 which runs on a companion computer?

The connections are established between ros2 and px4 successfully using xrce dds , topics are being published from px4, when i use ros2 topic list it is working fine, but when i tried to arm cube orange plus, its arming but not in a single publish, when i tried publishing multiple times it is working, but it is also random, like sometimes it arms by publishing 10 times, 20 times, 5 times and even on single publish. why this is happening?