If the provided source is cut down to the lines that have to do with the temperature, it is just this. If you try this sketch it should behave equally "wrong":
const int sensor = A5;
vout = analogRead(sensor);
tempc = (vout * 500) / 1023;
Here is an example of some code I used to read two encoders using pin change interrupts. This is possible to do with one ISR since they all share a common port. The key is it has to be short. As long as you can keep all 6 pins from your encoder on the same port, this should be easy to extend to 3 encoders. It might even work for four on one port. Or you ...
GPIO12 must not be pulled high during boot. It's possible there's a pull-up resistor on the BME680 breakout board you're using that's pulling SCK high and interfering with the boot process. I would avoid using GPIO12 here.
If you're out of pins on the ESP32 you can connect the BME680 via I2C rather than SPI. I2C only needs SDA and SCK (and power and ground, ...