Dephasing in sodium Ramsey interferometry under a weak inhomogeneous magnetic field