After a few tests it becomes unresponsive

Windows 10 toolchain.
SITL with jMAVSim (headless)

BUILD SUCCESSFUL
Total time: 0 seconds
Options parsed, starting Sim.
GUI not enabled
INFO  [simulator] Simulator connected on TCP port 4560.
Init MAVLink
INFO  [commander] LED: open /dev/led0 failed (22)
INFO  [init] Mixer: etc/mixers/quad_w.main.mix on /dev/pwm_output0
INFO  [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
INFO  [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO  [ecl/EKF] 912000: EKF aligned, (baro height, IMU buf: 22, OBS buf: 14)
INFO  [ecl/EKF] 912000: reset position to last known position
INFO  [ecl/EKF] 912000: reset velocity to zero
INFO  [logger] logger started (mode=all)
INFO  [logger] Start file log (type: full)
INFO  [logger] Opened full log file: ./log/2020-03-19/15_59_09.ulg
INFO  [mavlink] MAVLink only on localhost (set param MAV_BROADCAST = 1 to enable network)
INFO  [px4] Startup script returned successfully
pxh> INFO  [ecl/EKF] 9888000: GPS checks passed (WGS-84 origin set)
INFO  [ecl/EKF] 14416000: reset position to GPS
INFO  [ecl/EKF] 14416000: reset velocity to GPS
INFO  [ecl/EKF] 14416000: commencing GPS fusion
INFO  [mavlink] partner IP: 127.0.0.1
INFO  [commander] Takeoff detected
INFO  [commander] Landing at current position
INFO  [commander] Landing detected
INFO  [logger] closed logfile, bytes written: 1596341
WARN  [commander] Data link lost
INFO  [logger] Start file log (type: full)
INFO  [logger] Opened full log file: ./log/2020-03-19/15_59_53.ulg
INFO  [commander] Takeoff detected
INFO  [commander] Landing at current position
INFO  [commander] Landing detected
INFO  [logger] closed logfile, bytes written: 697565
WARN  [commander] Data link lost

I can run at most a few tests (running python scripts using MAVSDK) but then the drone becomes unresponsive. I can only shut down and restart.

If I check mavlink status:

pxh> mavlink status

instance #0:
        mavlink chan: #0
        type:           GENERIC LINK OR RADIO
        flow control: OFF
        rates:
          tx: 13.614 kB/s
          txerr: 0.000 kB/s
          tx rate mult: 1.000
          tx rate max: 4000000 B/s
          rx: 0.000 kB/s
        FTP enabled: YES, TX enabled: YES
        mode: Normal
        MAVLink version: 1
        transport protocol: UDP (18570, remote port: 14550)

instance #1:
        GCS heartbeat:  17612000 us ago
        mavlink chan: #1
        type:           GENERIC LINK OR RADIO
        flow control: OFF
        rates:
          tx: 24.761 kB/s
          txerr: 0.000 kB/s
          tx rate mult: 1.000
          tx rate max: 4000000 B/s
          rx: 0.000 kB/s
        FTP enabled: YES, TX enabled: YES
        mode: Onboard
        MAVLink version: 2
        transport protocol: UDP (14580, remote port: 14540)
        partner IP: 127.0.0.1

I don’t understand, but it seems to me that PX4 and jMAVSim no longer communicate, but I can’t understand why and where this happens.
Please help.