Led not working with pwm

Hello,

in my sketch I have a subroutine that blinks the power led regarding the choosen program my device runs in.

It works fine with digitalWrite.

Today I bought this button with LED inside:

https://www.voelkner.de/products/42844/Druckschalter-R13-529-Bl-Blau-Led.html?ref=43&products_model=D79523&gclid=Cj0KCQjwv_fKBRCGARIsAL6R6egPLh3dciGlDbpNaVL4F_TrihirD_0G2j-58z8MLd79DazlCDcxmQEaAtu2EALw_wcB

It works fine as well (btw. it is connected to Pin 10 then 240R to GND).

But because it was way too bright I changed my digitalWrite's to analogWrite and did want to set a value to make it less bright.

My Problem is as soon as I change the value to any other than 255 it completely goes off instead darker as expected.

Any ideas?

Maybe I need to remember I set my PWM frequency to 31 or 4khz for the motor connected to pin9. So I assumed maybe the LED for some mysterious reason cant handle that.
But even changing the PWM frequency back to 500Hz didn’t change anything.

I also just found the fading example works fine.
But I cannot find any problem in my code…

If I just copy the routies for blinking and button in another sketch everything works fine…

Ah..... I think I got it.... must be that damn Servo lib....

Never mind....