Arduino mega not working on some pins in PWM mode.

I’m on a project using arduino mega and IRremote sensor.
And found that the sketch code that works fine on Arduino Uno does not work on Arduino mega.
And I got down to the minimum sektch code that works fine in Arduino Uno but doesn’t work in Arduino mega.

The circuit shema and the sketch codes are shown below.

The sketch code is shown below.

#include <IRremote.h>

int LED_R = 9;
int LED_G = 10;
int LED_B = 11;

int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);

decode_results results;
void setup() {

irrecv.enableIRIn(); // Start the receiver
// put your setup code here, to run once:
pinMode(LED_R, OUTPUT);
pinMode(LED_G, OUTPUT);
pinMode(LED_B, OUTPUT);

void rgb_on(int R, int G, int B)
analogWrite(LED_R, R);
analogWrite(LED_G, G);
analogWrite(LED_B, B);

void loop() {
// put your main code here, to run repeatedly:
rgb_on(127, 127, 127);

By Uploading on Arduino Uno the RGB LED lamp is turned on in half the maximum brightness in all R,G,B components. This is the expected behavior.
But Uploading the same sketch code to Arduino mega the RGB LED lamp is not turned on.
But By commenting out the “irrecv.enableIRIn();” line on Arduino mega the RGB LED lamp is turned on in half the maximum brightness.
Is this behavior intrinsic Arduino Mega bug? or I have faulty arduino mega product?
My Arduino mega product is genuin original product not some compatible version.
Using other pin numbers such as 3, 5, 6 for RGB LED lamp makes above sketch code work fine for both arduino uno and mega.
Only pin number 9,10,11 do not work on arduino mega.

According to documentation: PWM: 2 to 13 and 44 to 46. Provide 8-bit PWM output with the analogWrite() function.-- that's off the site.