Origin of the butterfly magnetoresistance in a Dirac nodal-line system