I have an RGB LED hooked up to pins 7,8 and 9 on my Elegoo Mega2560. If I apply analogWrite(, 255) to each pin, I get a white light as expected. However, if instead, I apply analogWrite(, 225) to each pin, I get a yellow light, as if the blue pin 9 is LOW. To confirm, if I physically disconnect pin 9, it makes no difference to the light.
In case this is a library/timer issue, my sketch is also using the membrane keypad library and the IR Receiver library.
The IR Receiver library probably uses a timer. See which timer it uses and make sure it isn't the same timer that controls PWM on pin 9.