One of the reasons causing inaccurate could be the magnetic sensor calibration. When not callibrated properly, the sensor data may be wrong leading to incorrect lap estimation.
To perform a calibration to improve the sensor settings. Access the Marlin App.
In iOS, the calibration can be accessed in the Devices menu. Follow the instructions to perform the calibration.
For Android, it can be accessed in a similar fashion. Follow the instructions to perform the calibration.
Once it has been recalibrated, swim again and see if results are improved. If issues persist, please contact firstname.lastname@example.org or issue a trouble ticket.