I just tested this on my end and did not get the same results as you are reporting. It almost looks like your breaks/indents are getting removed and it truncates the beginning of your first lines.
I’m working on a pc. However maybe it’s more of the way I’m working then the node it’s self. I don’t type the code directly into the code box. Instead I’ve been opening up notepad++ writing the script there and then just copy paste in in to the node. Maybe that has something to do with it.
I would make sure that your workflow is not the cause of the issue, as it sounds like the notepad++ could be part of the reason copy/pasting is not working as expected.