Serial.print skips or hangs inside a "if" statement. Trying to call a function VIA serial uart
High likely you are exceeding your character array, see:
char a[5];

Which can hold 5 characters. However, you write:
if(strcmp(a,&quot;RGB_1&quot;) == 0)

Which assumes you receive &quot;RGB_1&quot; which is 6 characters, because a string ends with a 0.
What also might happen is that you indeed receive only 5 characters without the ending newline, which means strcmp keeps searching until it finds a string end which may not happen.
So you can increase the array size a few just for testing purposes, and print i as jsotola proposes. Beyond that, also print each character you put into the array so you know how/if to handle a new line.
If you don't receive a string end, then use instead of the strcmp function, then use strncmp, which can search for exactly 5 characters, not checking until the end of the string.