Yet another topic about BME280

I’m quite new to the ESPhome but I think I’ve pretty much understood its working principles thanks to the excellent tutorials and guides. Now I was trying to make a simple environmental sensing station using a Wemos D1 mini lite, a BME280 and a MAX44009 light sensor.

I wired them to the D1 and D2 pins and everything seemed to work, I was getting good values and the sensors were responding to external stimuli. I turned off the PC and came back after an hour.
Well, I don’t know what happened during my absence but now both the I2C sensors are not working. Here the error:

[C][bme280.sensor:081]: Setting up BME280...
[20:11:38][W][i2c:070]: Received NACK on transmit of address 0x76
[20:11:38][E][component:092]: Component was marked as failed.

the resulting values for the BME are all nan while the light intensity is 0.000.
Running an I2C scanner sketch on the Wemos I can see the sensors at 0x76 and 0x4A, as in the code.

Here is the code, should be correct as it was taken from the official guide

  sda: 4
  scl: 5
  scan: true


  - platform: custom
    lambda: |-
      auto lux_sensor = new MAX44009Sensor();
      return {lux_sensor};
      name: "Ambient Light"
      id: max44009
      state_topic: ${device_name}/feeds/light
      unit_of_measurement: 'lux'
      accuracy_decimals: 1

  - platform: bme280
    address: 0x76
      name: "Temperature"
      id: bme280_temperature
      state_topic: ${device_name}/feeds/temperature
      unit_of_measurement: '°C'
      discovery: True
      filters: []
      name: "Pressure"
      id: bme280_pressure
      state_topic: ${device_name}/feeds/pressure
      unit_of_measurement: 'hPa'
      discovery: True
      filters: []
      name: "Relative Humidity"
      id: bme280_humidity
      state_topic: ${device_name}/feeds/rel_humidity
      unit_of_measurement: '%'
      discovery: True
      filters: []
    update_interval: ${update_interval}

When I click on Show Logs on my bme280 I get the following:

[13:38:38][C][i2c:028]: I2C Bus:
[13:38:38][C][i2c:029]:   SDA Pin: GPIO4
[13:38:38][C][i2c:030]:   SCL Pin: GPIO5
[13:38:38][C][i2c:031]:   Frequency: 50000 Hz
[13:38:38][I][i2c:033]: Scanning i2c bus for active devices...
[13:38:39][I][i2c:040]: Found i2c device at address 0x76

Check that you get the same