Hey @nxt_pa, hopping in here. Are you using the EV3 or the older NXT brick? This should work fine on the NXT brick; it may not be as reliable on the EV3. One thing you might want to try in testing is putting pauses in between reads; the I2C line can get locked up if it's read too quickly.
Because the sensor is able to read sometimes, it indicates the sensor is working, and the problem might be in the software.
Also, just to check: are there any other sensors on the same line? Are you using an I2C hub or anything like that?