Weird keypad behaviour

I have an I2C LCD and a Keyboard and was trying to make a Time input system.
It works great until I press '*' for deleting and start introducing time again. After that, it still works BUT when I press the '1' key it's detected as a '0'. This is all the code I have. And as it works until I erase Time, I'm guessing it's not a wiring problem. After all my Arduino has been connected for a while without experiencing troubles in other projects.

//INCLUDES
#include <Keypad.h>
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display
//La dirección de mi pantalla no es 0x27, es 0x3F

char Tiempo[9] = {'0', '0', ':', '0', '0', ':', '0', '0'};

boolean configurada = false;

const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte colPins[COLS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte rowPins[ROWS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


void setup() {
    
  Serial.begin(9600);
  lcd.init();
  lcd.blink();
  lcd.backlight();

  lcd.setCursor(0,0);
  lcd.print("*Borrar #OK");
  //Serial.println("Introduzca horas y pulse #. * para borrar");
  lcd.setCursor(0,1);
  lcd.print("00:00:00");
  lcd.setCursor(0,1);
  int cursorpos = 0;
  
  while (configurada == false){

      char key = keypad.getKey();

      if ((key != NO_KEY) && (key != '*')&&(key != '#') && (key <= '9') && (key >= '0')){

        Serial.println(key);
        lcd.print(key);
        Tiempo[cursorpos] = key;

        switch(cursorpos){ //00:00:00 -> indexes 01 2 34 5 67 

          case 1: 
            cursorpos = 3; 
          break;

          case 4: cursorpos = 6; break;

          case 7: ;break;

          default: cursorpos++; break;
       
        }
      }

      if ((key != NO_KEY) && (key == '*')){
        Serial.println("WTF?!");
        cursorpos = 0;
        lcd.setCursor(0,1);
        lcd.print("00:00:00");
        Tiempo[9] = '00:00:00';

          
      }

      if ((key != NO_KEY) && (key == '#')){
        Serial.println(key);
        Serial.println(Tiempo);
      }
    lcd.setCursor(cursorpos,1);
    delay(200);    
  } 
}

void loop() {
}

Update: If I comment out all "Tiempo" (Time in spanish) references, it works correctly.

 Tiempo[9] = '00:00:00';

This clearly wrong. Tiempo is a nine element array, but arrays are 0 indexed, and they run from 0 to 8. Tiempo[9] is memory you don't own. Also you are trying to place more than a char into that space.

cattledog:

 Tiempo[9] = '00:00:00';

This clearly wrong. Tiempo is a nine element array, but arrays are 0 indexed, and they run from 0 to 8. Tiempo[9] is memory you don't own. Also you are trying to place more than a char into that space.

I declared Tiempo inside void setup() and now it works.

I've written Tiempo[9] after reading this: https://www.arduino.cc/en/Reference/String

I declared Tiempo inside void setup() and now it works.

I'd still need to see your current code, to have so confidence in that.

I've written Tiempo[9] after reading this: https://www.arduino.cc/en/Reference/String

I can't imagine the relationship between those two statements.