The escaping that separates a working CSV from a broken one
CSV looks trivial until a value contains a comma. The convention is to wrap such a value in double quotes; a value containing a double quote escapes it by doubling it; a value containing a newline must be quoted or the row splits in two. Get any of those wrong and the file still opens — with the columns shifted from that row onward.
This is the reason to convert with a tool rather than a template string. The failure mode is not an error message, it is a spreadsheet where one customer's address has pushed every subsequent column one place to the right, and nobody notices until a report is wrong.