Clean the format closest to the source of the error. If rows and headers are wrong, fix the CSV before converting it. If nested keys or values are wrong, inspect the JSON structure before flattening it.
Work on a small representative sample, then convert once and compare the output with the original. Repeated back-and-forth conversion can hide lost fields, changed types, or broken quoting. Keep the untouched source for verification.
Which format currently shows the problem most clearly?