Incomplete serial string input
Your code has no idea when the string is finished. At the moment it is just waiting until the receive buffer is empty (Serial.read() returns -1), but since serial is a slow protocol that could happen at any time, not just at the end of the string.

You need something to terminate your string so it knows when the end is. The most common way is to use a line feed character (\n, character 10) or a carriage return (\r, character 13) or a combination of the two.

char c;
while ((c = Serial5.read()) != '\n') {
    if (c != 255) {
        str.concat(c);
    }
}

// Output the string on the serial debug interface
Serial.print("Read: \"");
Serial.print(str);
Serial.print("\"\n");