Strange message in midi.onSysex

I am using the following code in LUA.

I get a strange message like this when sending a sysex dump (650 bytes) to Electra.

What does that mean, does Electra lose midi bytes?

I tested a much shorter (40 bytes) midi sysex message and then I didn’t get any error.

UPDATE:

I asked ChatGPT. If you have a large SysEx message (for example, hundreds of bytes), your for loop will print a huge amount of text.
Some environments (such as REAPER ReaScript, MIDI monitors, or embedded Lua) may truncate or corrupt the log output when there’s too much printed data.

Is this the correct answer Martin?

I have seen that it calculates correctly when it comes to the length of the sysex message so maybe this is not a problem…

A sysEx message of a few hundred bytes is nothing special…

Do check there is no MIDI clock running, incoming in the E1. There was an issue with the first version V4 beta release that the MIDI clock got intercepted as part of the sysEx leading to strange results.
Not sure that’s the reason but better first exclude it , I’d say.

However, if you’re printing out those kinds of debug statements in a timer loop or in some other high volume routine, it will definitely glitch.

Note that the logic didn’t break, it’s just the output that messes up

Does it occur at the same byte every time?