Esp8266 doe not connect to WiFi while using Arduino IOT cloud

So, I'm just getting started the Arduino IOT cloud platform, my project is a car that can be controlled using a PC/Mobile.

After setting up the variables and the dashboard and the code, it worked ok, but after I made a few changes like a new variable and some minor code changes, it stopped working and it printing this on the serial monitor

Retrying in  "500" milliseconds```

Why could this be?

My code-

#include "arduino_secrets.h"
/*
  bool forward;
  bool back;
  bool left;
  bool right;
*/

#include "thingProperties.h"

void setup() {

  Serial.begin(9600);
  initProperties();
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();

  //Left
  pinMode(4, OUTPUT); //Forward
  pinMode(0, OUTPUT); //Back

  //Right
  pinMode(14, OUTPUT); //Forward
  pinMode(12, OUTPUT); //Back

}

void loop() {
  ArduinoCloud.update();
}


void onForwardChange()  {
  if (forward == 1) {
    digitalWrite(4, HIGH);
    digitalWrite(14, HIGH);
  } else {
    digitalWrite(4, LOW);
    digitalWrite(14, LOW);
  }
}

void onBackChange()  {
  if (back == 1) {
    digitalWrite(0, HIGH);
    digitalWrite(12, HIGH);
  } else {
    digitalWrite(0, LOW);
    digitalWrite(12, LOW);
  }
}

void onLeftChange()  {
  if (left == 1) {
    digitalWrite(14, HIGH);
    digitalWrite(0, HIGH);
  } else {
    digitalWrite(14, LOW);
    digitalWrite(0, LOW);
  }
}

void onRightChange()  {
  if (right == 1) {
    digitalWrite(12, HIGH);
    digitalWrite(4, HIGH);
  } else {
    digitalWrite(12, LOW);
    digitalWrite(4, LOW);
  }
}

Remove the device and add it again, see https://support.arduino.cc/hc/en-us/articles/4404652027538-My-ESP8266-or-ESP32-board-is-not-connecting-to-the-Arduino-IOT-cloud

https://docs.arduino.cc/cloud/iot-cloud/tutorials/iot-cloud-getting-started