It is possible that sometimes the smart devices compass sensors can act erratically or can deliver incorrect results in such a case it is necessary to calibrate the sensors by performing following the instructions shown.
The following is only visible after the calibration operation has finished.