The compass in Gmaps is messed up on a 40klm trip it shows my car is going backwards or even sideways im not that skilled driver

tried to recalibrate it using the compass applications that comes with the phone and through gmaps but nothing worked expect when i restart the phone it fixed for a bit.The key word is for a "bit" Now its messed up again.