Are you using GPIOs as I2C?
Arduino has assigned I2C pis and depends on I2C there is pull up resistor or not.
I strongly recommend to use assigned I2C pins.
Please check our bsec 2 library example code.
Our example code is based on Arduino. -2 means communication error, so it means that there is hardware or software issue for communication.