Switch/case statement only works halfway through

So I am trying to make an IR controlled LEDs box. I am using a switch/case statement to decide what to do when an IR code is received. I had written a couple for loops to loop through my three LEDs, but any of the cases below that code does not get executed. I figured it was a missing bracket but when I look through them they all appear to be in the correct spots! The last case that seems to work is

case 0xFFE21D:

Switch statement:

switch (value) {
    case 0xFFA25D:
      Serial.print(" >> Power button\n");
      if (ledOnState) {
        ledOnState = false;
        digitalWrite(ledPins[0], LOW);
      } else {
        ledOnState = true;
        digitalWrite(ledPins[0], HIGH);
      }
      break;
    case 0xFFE21D:
      Serial.print(" >> Menu button\n");
      turnOffAllPins();
      delay(150);
      int randPin = rand() % 3;
      Serial.println(randPin);
      if (ledOnState) {
        ledOnState = false;
        digitalWrite(ledPins[randPin], LOW);
      } else {
        ledOnState = true;
        digitalWrite(ledPins[randPin], HIGH);
      }
      break;                      <<<<< ANYTHING BELOW THIS DOES NOT RUN.
    case 0xFF22DD:
      Serial.print(" >> Test button\n");
      break;
    case 0xFF02FD:
      Serial.print(" >> Plus button\n");
      /*if (ledBrightness == 0) {
          ledBrightness = 120;
      } else if (ledBrightness == 120) {
          ledBrightness = 140;
      } else if (ledBrightness == 140) {
          ledBrightness = 255;
      }
      analogWrite(ledPin, ledBrightness);*/
      break;
    case 0xFFE01F:
      Serial.print(" >> Rewind button\n");
      break;
    case 0xFFA857:
      Serial.print(" >> Play button\n");
      break;
    case 0xFF906F:
      Serial.print(" >> Fast forward button\n");
      break;
    case 0xFF6897:
      Serial.print(" >> Zero button\n");
      turnOffAllPins();
      break;
    case 0xFF9867:
      Serial.print(" >> Minus button\n");
      /*if (ledBrightness == 255) {
        ledBrightness = 140;
      } else if (ledBrightness == 140) {
        ledBrightness = 120;
      } else if (ledBrightness == 120) {
        ledBrightness = 0;
      }
      analogWrite(ledPin, ledBrightness);*/
      break;
    case 0xFFB04F:
      Serial.print(" >> C button\n");
      break;
    case 0xFF30CF:
      Serial.print(" >> One button\n");
      for (int i = 0; i <= 10; i++) {
        digitalWrite(ledPins[2], HIGH);
        delay(150);
        digitalWrite(ledPins[2], LOW);
        delay(100);
      }
      break;
    case 0xFF18E7:
      Serial.print(" >> Two button\n");
      for (int i = 0; i <= 10; i++) {
        digitalWrite(ledPins[1], HIGH);
        delay(150);
        digitalWrite(ledPins[1], LOW);
        delay(100);
      }
      break;
    case 0xFF7A85:
      Serial.print(" >> Three button\n");
      for (int i = 0; i <= 10; i++) {
        digitalWrite(ledPins[0], HIGH);
        delay(150);
        digitalWrite(ledPins[0], LOW);
        delay(100);
      }
      break;
    case 0xFF10EF:
      Serial.print(" >> Four button\n");
      break;
    case 0xFF38C7:
      Serial.print(" >> Five button\n");
      break;
    case 0xFF5AA5:
      Serial.print(" >> Six button\n");
      break;
    case 0xFF42BD:
      Serial.print(" >> Seven button\n");
      break;
    case 0xFF4AB5:
      Serial.print(" >> Eight button\n");
      break;
    case 0xFF52AD:
      Serial.print(" >> Nine button\n");
      break;
    case 0xFFC23D:
      Serial.print(" >> Back button\n");
      bool firstIteration = true;      
      for (int i = 0; i <=5; i++) {
        if (firstIteration) {
          for (int i = 0; i <= 2; i++) {
            digitalWrite(ledPins[i], HIGH);
            Serial.print("LED ON: ");
            Serial.print(ledPins[i]);
            Serial.println();
            delay(150);
            digitalWrite(ledPins[i], LOW);
            delay(100);
          }
          for (int i = 1; i >= 0; i--) {
            digitalWrite(ledPins[i], HIGH);
            Serial.print("LED ON: ");
            Serial.print(ledPins[i]);
            Serial.println();
            delay(150);
            digitalWrite(ledPins[i], LOW);
            delay(100);
            firstIteration = false;
          }
        } 
        else {
          for (int i = 1; i <= 2; i++) {
            digitalWrite(ledPins[i], HIGH);
            Serial.print("LED ON: ");
            Serial.print(ledPins[i]);
            Serial.println();
            delay(150);
            digitalWrite(ledPins[i], LOW);
            delay(100);
          }
          for (int i = 1; i >= 0; i--) {
            digitalWrite(ledPins[i], HIGH);
            Serial.print("LED ON: ");
            Serial.print(ledPins[i]);
            Serial.println();
            delay(150);
            digitalWrite(ledPins[i], LOW);
            delay(100);
          }
        }
      }
    break;
  }

Edit: Added sketch as attachment.
I should clarify, I originally had my code working fine with my switch statement producing the ">> button name" for every single button on my IR remote no problem. it became problematic once I added all the code shown below. The code itself runs fine, but any other case after 0xFFE21D just does not execute anything.

case 0xFFE21D:
      Serial.print(" >> Menu button\n");
      turnOffAllPins();
      delay(150);
      int randPin = rand() % 3;                    //From this line,
      Serial.println(randPin);
      if (ledOnState) {
        ledOnState = false;
        digitalWrite(ledPins[randPin], LOW);
      } else {
        ledOnState = true;
        digitalWrite(ledPins[randPin], HIGH);//To this line.
      }

IR_to_serial.ino (5.08 KB)

Please post a complete sketch showing the problem. For instance, how and where are you reading value ?

Thank you for the reply, I edited my post with a pastebin link to the full sketch and added "<<<< ANYTHING UNDER THIS DOES NOT RUN." in my case statement that seems to be problematic

Post the code here to make it easy to access. If it is too large to post inline then attach it to a post

This is wrong for a start...

for (int i = 0; i > 2; i++){
    pinMode(ledPins[i], OUTPUT);
}

How are you determining “it doesn’t run”?
Supply your debug output from the serial monitor showing what this debug lines produced...

Serial.print(results.value,HEX);

And that this, with the correct stimulus, did in fact not output nothing...

printResult(results.value);

And this is highly questionable...

      for (int i = 0; i <=5; i++) {
        if (firstIteration) {
          for (int i = 0; i <= 2; i++) {

Maybe those are different i loop variables, maybe not. I count myself a fairly proficient C/C# programmer, although I’ll confess my C++ skills are a bit lacking. But I’ve no idea myself, and no programmer, however experienced, that I know of would risk confusing themselves, or more importantly others, with it.

Never redeclare a variable name at a lower level scope to override one at a higher level.
IMHO the language spec ought to have outright forbidden it as it serves no useful purpose.
Same local variable name in different functions (same level of scope) is acceptable.

I get a bunch of warnings when I try to compile the sketch. The first one is:

/Users/john/Downloads/IR_to_serial/IR_to_serial.ino: In function 'void printResult(long unsigned int)':
/Users/john/Downloads/IR_to_serial/IR_to_serial.ino:74:10: warning: jump to case label [-fpermissive]
     case 0xFF22DD:
          ^~~~~~~~
/Users/john/Downloads/IR_to_serial/IR_to_serial.ino:62:11: note:   crosses initialization of 'int randPin'
       int randPin = rand() % 3;
           ^~~~~~~

This will prevent any of the 'case' entries after that point from working.

The problem is that you can't initialize a local variable inside a case unless it is local to that case:

    case 0xFFE21D:
      Serial.print(" >> Menu button\n");
      turnOffAllPins();
      delay(150);
      int randPin = rand() % 3;  /////////// THIS IS THE PROBLEM
      Serial.println(randPin);
      if (ledOnState)
      {
        ledOnState = false;
        digitalWrite(ledPins[randPin], LOW);
      }
      else
      {
        ledOnState = true;
        digitalWrite(ledPins[randPin], HIGH);
      }

An easy way to fix it is to put that one case inside brackets so it doesn't share the variable with other cases:

    case 0xFFE21D:
      {
      Serial.print(" >> Menu button\n");
      turnOffAllPins();
      delay(150);
      int randPin = rand() % 3; 
      Serial.println(randPin);
      if (ledOnState)
      {
        ledOnState = false;
        digitalWrite(ledPins[randPin], LOW);
      }
      else
      {
        ledOnState = true;
        digitalWrite(ledPins[randPin], HIGH);
      }
      }

Note: That 'case' doesn't have a 'break;' at the end. Did you intend for it to drop through into the next case?