I'm Alberto, from the TAM team.
I don't have a B402 at hand but I will try to replicate your issue. If you print all the results, not only the mismatch, does it appear any pattern?
The issue appears to be with the first byte received on every message I send to Serial1. For instance, if I send 16 bytes, values 0-15, The first peeked byte is -1, but the read is 0. Then every byte after matches. If I send the bytes multiple bytes, the first 1st received byte is always -1 according to peek. Additionally, if I instead send 1-16, then peek will also report the first byte as -1, whereas read reports 1. -1 is supposed to indicate no data available, but I check if there are bytes available with the available function before peeking and reading.
If you exceed the size of the serial read FIFO, the data can be discarded between the peek and read. The default size is 64 bytes. You can make it larger using acquireSerial1Buffer.
Additionally, this happens every time I send small messages, such as 16 bytes. Even if I wait until available() returns 16 bytes and then start peeking/reading, the first byte peek() returns -1, whereas read returns the byte.