How to edit a FIT file swimming activity?

I am trying to edit a FIT file (removing a few latest wrong laps during a swimming workout that mess up a lot with the final total distance).

I was planning to use the Python SDK for the job, but it seems to only read FIT files without being able to save FIT files (see https://forums.garmin.com/developer/fit-sdk/f/discussion/324760/add-create-fit-file-capability-to-fit-python-sdk for a discussion on this topic).

I finally gave a shot to `FitCSVTool.jar` (see https://developer.garmin.com/fit/fitcsvtool/commandline/) and I have been able to correctly convert FIT to CSV, but I cannot convert back to FIT from the generated CSV (even without any edits of the CSV file).

The generated FIT file is created with no errors, but the upload on Garmin Connect fails.

I tried using the `-u` argument with no success.

---

1) Can someone provide guidance how to correctly use `FitCSVTool.jar` to convert FIT -> CSV -> FIT while being able to upload on Garmin Connect.

2) Even better would be able to save FIT file from Python, so any timeline on this topic if relevant would be nice :-)