Thank you Marti for the reply.
The problem was indeed in the connection between the nRF52840DK and the external sensor. I watched your video, it was very good and informative.
As I learned that the device will be initialized before execution is in application code, I realize we will have a problem with the driver in our own product. Our own board will have a sht31 sensor but it is behind a TCA9548A I2C switch, which means a device tree configuration like this:
Can I stack the drivers like this? If yes, to be able to use the available device drivers for the sensors that are behind the I2C switch, I will need to implement the tca9548a functionality to a device driver to make this work. Do you know are there any example to use as a starting point?