There’s 5 parameters that follow the device name and indices array, but you only have 4.
Your code would be clearer and the mistakes spotted easier if you used named parameters for all the parameters, e.g.:
system.dnp3.directOperateBinary(deviceName="Dnp3", indexes=[1], opType=1, tcCode=0, count=1 onTime=5000, offTime=5000)