UART Communication Issue: Arduino Uno to Nano 33 BLE Sense Rev 2

Check whether characters are actually available before attempting to read them.

To learn about reliable serial communications, I recommend to spend some time studying the Serial Input Basics tutorial.