Running gcode in Studio and with Python run_gcode_file() is not the same (Lite6)

When trying to run this gcode file, I got different results when running in xarm studio and with Python SDK:

G21       ; mm
G1 Z300 ; pen up
G1 X280 Y10 
G1 Z300 ; pen up
G1 X255 Y-15
G1 Z80 ; pen down
G1 X255 Y-15 ; line start
G1 X255 Y-15 ; line end
G4 P 12 ; dwell for 12 sec
G1 X255 Y-15 ; line start
G1 X255 Y-94 ; line end
G4 P 12 ; dwell for 12 sec
G1 X255 Y-94 ; line start
G1 X255 Y-173 ; line end
G4 P 12 ; dwell for 12 sec
G1 Z300 ; pen up

When running from xarm studio, the code works fine with dwell commands, but when sending the same file via run_gcode_file(), those commands are skipped. Also, this code consists of three lines, which studio executes well, but again, running run_gcode_file() executes just the first two lines.

Firmware and Studio Version are both 2.3.0.
Python SDK Version: 1.13.19

Hi Azurenoise,

run_gcode_file is for our internal use, currently doesn’t support dwell commands, you can see what command we currently support in run_gcode_file in ‘send_cmd_sync’.
We will evaluate if to add support for G4 for these 2 APIs.

BTW, You can send all Gcode yourself via socket connection, for your reference:
UFACTORY Gcode | UFactory docs

Best regards,
Minna