The lines are deformed

Do you have any idea why the lines are distorted
, despite being a straight line… it measures 180m

Are they actually distorted… or do you mean the display is distorted?

If the line is the correct length, but the display is looking wonky, its most likely that your geometry is very far from the origin. All software, Dynamo included, start to struggle with things super far away from the origin.

To get around this, you can translate the geometry to the origin to do the calculations you are doing, then translate it back for accurate push back into Civil3D

Check geometry scaling.
Recommend that you set it to medium even if you get error message it’s ok.