In src/lib/sensor_calibration/Magnetometer.hpp, the function matrix::Vector3f Correct(const matrix::Vector3f &data) appears to be missing the _thermal_offset term that is set by subscribing to the sensor_correction topic. I believe this should be added so that the function reads:
return _rotation * (_scale * ((data + _power * _power_compensation) - _thermal_offset - _offset));
Otherwise, the thermal compensation offset is never applied for the magnetometer. I was planning to raise this issue in PX4 Github, but I wanted to post here first to verify this. Thanks!