Calling the Bluetooth magnetometer service in MakeCode does not trigger the calibration on it's own, so it has to be initiated via BLE eg from an app, or by using the calibrate compass block in your program.

 The calibration is stored in non volatile memory, so you won't need to calibrate every time you turn on the device - just the first time after programming.