Select GPIO from the scheme of your tiles, not just from the number you find in case of code. Some connectors have restrictions or already serve memory, USB-and start-up.
A key that holds the start-up connection in the wrong state when switched on can prevent the running of an otherwise correct program. Try starting with the unplugged key and then select a more suitable GPIO.
To ESP32 do not connect 5-V either 24-V signals directly. Connection designation on connector and GPIO number in code are not always the same thing.
Select products according to the above criteria; the list is not a confirmation that they are all interchangeable.
ESP32 38 pin WIFI IoT Bluetooth
ESP32-S3 N16R8 WiFi development panel BT 8MB PSRAM
Double 5V DC automatic relay with diode and optocopler