The manufacturer of the ESP32-chip made breaking changes between ESP32-core versions 2.0.X and 3.X
So depending on the core-version that you are using you might have to adapt the code.
You can read about the differencies here
You posted one of this awful fritzimg pictures. This does not show your realitiy.
You should take high-resolution pictures from vertically above.
Take the picture and then look at the picture again if PCB-letters are easy to read and only in case you took the picture from vertically above it will be easy to see to what exact pin the wire is connected.
To state the obvious: Did you check the polarity of the LED?