I do have the following sketch that converts three bytes into a long using bit shifts.
What really puzzles me is that thios code is working on an ESP32 but the same code produces a different result on an Arduino 168.
Your values to be bit shifted are typed as bytes, and you are bit shifting them left to oblivion i.e. into numbers larger than the type can hold.
Integer promotion (Google this term) with the bit shift has created size for BatteryLevel <<8 with the Arduino as there are 16 bit integers. SensorValue needs to be cast as an unsigned long before the shift.