Your are getting "framing" errors.
You cannot rely on read() to always get exactly one NMEA sentence from beginning to end.
You need to add the data read to the end of a buffer, then detect the start and end of each NMEA sentence in the buffer, removing each detected sentence from the beginning of the buffer as it is found.
Like this:
FOREVER
read some data and add to end of buffer
if start of buffer does not have start of NMEA sentence
find start of first NMEA sentence in buffer
if no sentence start found
CONTINUE
delete from begining of buffer to start of first sentence
find end of first NMEA sentence in buffer
if no sentence end in buffer
CONTINUE
remove first sentence from buffer and pass to processing
It is important, if you expect a NMEA application to work reliably in the real world, to handle framing errors. This sort of thing:
received output
$GPRMC,,V,,,,,,,,,N*53
$GPRMC,,V,,,,,,,,,N*53
$GPVTG,,,,,,,,N*30
$GPVTG,,,,,,,,N*30
$GPRMC,,V,,,,,,,,,N*53$GPVTG,,,,,,,,N*30
$GPRMC,,V,,,,,,,,,N*53
$GPVTG,,,,,,,,N*30
$GPRMC,,V,,,
----
,,,,,,N*53
$GPRMC,,V,,,,,,,,,N*53
The code to do this is available at
https://gist.github.com/JamesBremner/291e12672d93a73d2b39e62317070b7f