Why does my RFID ID reading function simply lock ALL of my system?

Hello, I have an Arduino 2560, an RFID rc522 and a tft screen working together, I have the following method:

Function Code:

if (!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) //VERIFICA SE O CARTÃO PRESENTE NO LEITOR É DIFERENTE DO ÚLTIMO CARTÃO LIDO. CASO NÃO SEJA, FAZ
    return; //RETORNA PARA LER NOVAMENTE
 cont--;
  /***INICIO BLOCO DE CÓDIGO RESPONSÁVEL POR GERAR A TAG RFID LIDA***/
  String strID = "";
  for (byte i = 0; i < 4; i++) {
    strID +=
    (mfrc522.uid.uidByte[i] < 0x10 ? "0" : "") +
    String(mfrc522.uid.uidByte[i], HEX) +
    (i!=3 ? ":" : "");
  }
  strID.toUpperCase();
  /***FIM DO BLOCO DE CÓDIGO RESPONSÁVEL POR GERAR A TAG RFID LIDA***/
 
  Serial.print("Identificador (UID) da tag: "); //IMPRIME O TEXTO NA SERIAL
  Serial.println(strID); //IMPRIME NA SERIAL O UID DA TAG RFID
 
  mfrc522.PICC_HaltA(); //PARADA DA LEITURA DO CARTÃO
  mfrc522.PCD_StopCrypto1(); //PARADA DA CRIPTOGRAFIA NO PCD

and in this method I write my card’s UID to a STRING

When I call the method inside the loop, my program just hangs everything on screen, but if I call it in setup, the program runs normally and detects the UID.

follow the code:

#include <SPI.h> // SPI Modules - Communication Required for RFID
#include <MFRC522.h> // RFID Library

#define RST_PIN 48 // Configurable, see typical pin layout above // ​​I changed the pin to this one because 5 a tft already uses
#define SS_PIN 53
void setup (void) {
  Serial.Begin (9600); // Initialize serial communications with the PC
  while (! Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
  SPI.begin (); // Init SPI bus
  mfrc522.PCD_Init (); // Init MFRC522
  delay (4); // Optional delay. Some board need more time after init to be ready, see Readme
  mfrc522.PCD_DumpVersionToSerial (); // Show details of PCD - MFRC522 Card Reader details
  Serial.println (F ("Scan PICC to see UID, SAK, type, and data blocks ..."));
    getUidRfid ();
  
  uint16_t ID = tft.readID ();
  if (ID == 0xD3) ID = 0x9481;
  tft.begin (ID);
  tft.setRotation (1);

  
    
  
  CELL1begin (31, 29);
  CELL2.begin (28, 30);
  CELL3.Begin (15, 14);
  CELL4.Begin (15, 14);
  //
  // CELL1.set_scale (520);
  // CELL2.set_scale (560);
  // CELL3.set_scale (520);
  // CELL4.set_scale (520);

  pinMode (Save button, INPUT);
  pinMode (Tara button, INPUT);
  pinMode (UP button, INPUT);
  pinMode (menu button, INPUT);
  pinMode (Down button, INPUT);

  reading Cell (10);
  deltaVfunction (10);
  initializationScreenLoading ();
  getUidRfid ();
  t1 = millis ();
  initialization ();
  numMenu = 1;
  
}