I am working on a smart switch. It has a 'Client' mode, when this switch act only like a controller to a bound light device. When user presses a button my device generates 2 type of events:
1) Multistate input cluster attribute report, indicating number of button presses (e.g. single/double/tripple press). This is sent using eZCL_ReportAttribute() call, network mode E_ZCL_AM_SHORT.
2) OnOff toggle command to the bound device (sent using eCLD_OnOffCommandSend() function, E_ZCL_AM_BOUND addressing mode)
These 2 events are generated one after another, without any other network/SDK calls in between.
In 95% cases everything works normally: attribute is reported to the coordinator, and coordinator responds with ACK first, and then with default response. The command is also sent normally (in my test coordinator is the target bound device)

Unfortunately in remaining 5% cases the On/Off Toggle command is corrupted, and just received Default response message is sent instead.

See line 3838 - this message is sent FROM the device, its content is almost identical to the message received in the previous line, but has a few fields changed (cluster is On/Off while the received default response was for multistate input).
Is there a way to get things more stable?