Nextion display and arduino uno serial issue

The capacitor is not intended to stop the display sending garbage over serial, it is intended to reduce the horrible amount of electrical noise the display injects into the power supply. As noted in my tutorial that noise was interfering with a GPS receiver I had on my bench at the same time.

This is wrong as you have an extra 'f' in each character, it should be 0xff. That said I don't see where in your code you use it.

Your code for receiving data from the Nextion has no start or end markers to show where the data starts and / or ends. Nextion use 0xff 0xff 0xff as an end marker and I use 0xa5 as a start marker for data sent from the Nextion to the Arduino. You seem to be relying on timing to do this, you are going to struggle with that approach. See Serial Input Basics - updated for an excellent account of how to do serial data transfer properly. The tutorial is not Nextion specific but the principals it explains are applicable to serial data transfer generally.

I never use Strings (upper case S), only c-strings AKA char arrays. There is a lot of discussion on here about whether or not Strings are safe on microcontrollers. Personally I just stay away from them. As for your code your use of them makes it harder for me to understand.

You've written everything inside the loop function. The is a terrible way to write anything but the simplest code. I suggest you learn to use functions to break your code into manageable chunks. Using functions makes it easier to read and easier to debug. All my sample code is broken down into functions.

If you are getting unexpected data back from a Nextion it is probably the return codes, which indicate that the Nextion is not happy with something you've sent it. See here for more about this: Instruction Set – Nextion

The following code is intended for a Nano Every and receives Nextion data up to the 0xff 0xff 0xff end marker and sends it to the serial monitor. Connect Rx1 of a Nano Every to the data you want to monitor, don't forget the ground. Best to use a 1k resistor in series with the data to stop phantom powering in the event all devices are not powered at the same time.

// Receives data on serial port 1 up to 0xff 0xff 0xff Nextion end marker
// Sends to serial monitor
// Intended for boards with at least 1 spare serial port

const uint16_t bufferSize = 256;
char DataRx[bufferSize];
uint16_t DataIndex = 0;
bool dataReady = false;
bool overflow = false;

const uint16_t baudDefault = 9600;
const uint16_t baudHeating = 57600;
const uint16_t baudHeatingNextion = 38400;

void setup() {
  char fileName[] = __FILE__;
  Serial.begin(115200);
  Serial.println("Serial monitor started");
  //Serial1.begin(baudDefault);
  //Serial1.begin(baudHeating);
  Serial1.begin(baudHeatingNextion); // Use the correct Baud rate for the data you are monitoring, change as required.
  Serial.println("Serial 1 started");
  Serial.println(sizeof(fileName));
  Serial.println(fileName);
  pinMode(13, OUTPUT);
}

void loop() {
  RxData();
  PrintData();
  runLED();
}

void RxData() {
    char RxTemp;
    static uint8_t charCount = 0;
    static uint8_t FFcount = 0;
    while (Serial1.available() > 0) {
        RxTemp = Serial1.read();

        //if ((uint8_t)RxTemp != 0xa5) {
        
        if ((uint8_t)RxTemp != 0xff) {
            DataRx[DataIndex] = RxTemp;
            ++DataIndex;
            if (DataIndex >= bufferSize) {
                DataRx[bufferSize - 1] = 0x00;
                DataIndex = 0;
                dataReady = true;
                overflow = true;
            }
        } else {
            ++FFcount;
            if (FFcount >= 3) {
                FFcount = 0;
                DataRx[DataIndex] = 0x00;
                DataIndex = 0;
                dataReady = true;
            }
        }
    }
}

void PrintData() {
  if (dataReady) {
    dataReady = false;
    if (overflow) {
      overflow = false;
      Serial.print("Buffer overflow: ");
    }
    Serial.println(DataRx);
  }
}

void runLED() {
  uint32_t currentMillis = millis();
  static uint32_t lastMillis;
  const uint32_t interval = 500;
  if (currentMillis - lastMillis >= interval) {
    lastMillis += interval;
    digitalWrite(13, !(digitalRead(13)));
  }
}