Conversion of String to Char

Value of inbyte is :42

The value of inbyte is NOT :42.

    while(!Serial.available()){}
   
    for(int p = 0; p < 10; p++){
    processIncomingByte (Serial.read ()); 
   }

If there is one (or more) bytes available to read, it is NOT OK to read 10 bytes.

Is there a way to fix it

Of course. But, I'm beginning to have my doubts that you will EVER be able to.

Serial input basics - updated