Offboard mode not able to arm

Hi Jurjen! You have a very interesting project, similar to the one I’m working on now. In my project, the Pixhawk 4 - RPi communication is functional, messages appear in the console (connection, arming, disarming). I’ll leave you a link to my post ( Autonomous rover using mavlink ) so you can see the code I used.
I suspect your problem is code-related. I recommend that we first do some tests, such as arm. You can use this command (you can find all the code in my post):

master.mav.command_long_send(
master.target_system, master.target_component,
mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM,
0, 1, 0, 0, 0, 0, 0, 0)
print(“Arm”)
time.sleep(2)

As far as I understand, the pilot is connected to the computer via serial. Try a USB pilot-computer connection to send commands.
I hope these tips help you!