There’s a lot more in those two SVGs that’s different beyond line breaks. The path data is completely different between the two. While they may render similarly, the actual path is created much differently in each.
E.g. The one that works uses relative bezier curves, whereas the one that doesn’t uses arcs, different math, different path construction.
There’s also fairly major differences that can choke some XML interpreters, such as not having the XML declaration, width/height being in inches instead of pixels, missing xml:space=“preserve”, etc. These things shouldn’t be an issue, but XML interpreters can be finicky.