Problem with pin of the nucleo or pwm

I found some problems with the use of pwm.
If I insert two rgb leds on my breadboard, connecting them to 6 pins in my nucleo, a led goes on and the other doesn't work, if I change the color, in a led the color corresponds to the one chosen while in the other comes a completely different color.
If I change the pins, with some of them the program does work.
Can it be a pin problem? Or am I wrong in pwm?

please post here the schematic of your circuit with details of the nucleo pins used and of the type of RGB led connected (common anode or common cathode)
moreover, I suggest to verify on the nucleo pinout (you can find it on the zerynth doc or directly on the zerynth studio using the dedicated button) if the board selected pins are PWM enabled.