Could not connect to ardupilot after signing setup passphrase from pymavlink

Hi guys, I have to complete the simulation project and I come across a confilict
I am running Ardupilot with command bellow

../Tools/autotest/sim_vehicle.py --console --map -w -D -f quad -A "--serial1=uart:/dev/pts/1:9600"

and then I set some params contains passphrase like these lines from mavproxy:

module load signing
signing setup AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
signing key AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
set allow_unsigned false
param set SERIAL1_PROTOCOL 2
param set SERIAL1_BAUD 9600
param set SERIAL1_OPTIONS 1

now i want to connect to the ardupilot via pymavlink lib
before I setup the passphrase the commands like take off and land and … will work correctly but after setting the passphrase with the command setup (signing setup AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) ; The ardupilot app doesn’t receive the mavlink requests
and when i disable signing and remove the key it works again
hint: i have the heartbeat , just my commands does’t receive in ardupilot
my mavlink code is this:

from pymavlink import mavutil

VALID_KEY = b"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
INVALID_KEY = b"BBBBBBbAAAAAAAAAAAAAAAAAAAAAAAAA"

master = mavutil.mavlink_connection("/dev/pts/0", baud=9600, source_system=255)

master.setup_signing(VALID_KEY, sign_outgoing=True)

print("waiting for valid with sign heartbeat")
master.wait_heartbeat(timeout=10)

command_message = """waiting for command press ...
't' to takeoff
'l' to land
'vk' change to valid key
'ik' change to invalid key
'q' to quit
"""

while True:
    print(command_message)
    char = input("command: ").strip().lower()
    if char == "t":
        print(f"timestamp: {master.timestamp}")
        print("Taking off...")
        master.set_mode("GUIDED")
        master.arducopter_arm()
        altitude = 10
        master.mav.command_long_send(
            master.target_system,
            master.target_component,
            mavutil.mavlink.MAV_CMD_NAV_TAKEOFF,
            0,  # Confirmation
            0,
            0,
            0,
            0,  # Optional Parameter
            0,
            0,
            altitude,
        )
    elif char == "l":
        print(f"timestamp: {master.timestamp}")
        print("Landing...")
        master.mav.command_long_send(
            master.target_system,  # شناسه سیستم هدف
            master.target_component,  # شناسه مؤلفه هدف
            mavutil.mavlink.MAV_CMD_NAV_LAND,  # فرمان فرود
            0,  # تأیید (confirmation)
            0,
            0,
            0,
            0,
            0,
            0,
            0,
        )
    elif char == "vk":
        print("Changing to valid key...")
        master.disable_signing()
        master.setup_signing(VALID_KEY, sign_outgoing=True)
    elif char == "ik":
        print("Changing to invalid key...")
        master.disable_signing()
        master.setup_signing(INVALID_KEY, sign_outgoing=True)
    elif char == "q":
        print("Quitting...")
        master.close()
        break
    else:
        print("Unknown command, please try again.")

also I tried lots of diffrent secret_keys (passphrases) and diffrent params of the ardupilot with mavproxy