In recent versions of Preview there are two annotation tools which seem almost identical: Sketch and Draw.
They both allow you to draw lines, but the difference is that Draw does not try to use shape detection.
Solution: Use Draw instead of Sketch.
Ignore the misleading icons, where it seems that Draw has a thicker line. You can always set the line thickness.
This tool appears only on computers with a Force Touch trackpad, but this is the case for most MacBooks.
Note: As said in a comment under, the Draw tool also changes the thickness of the line depending on Trackpad pressure, so consider this if you want to use the Draw tool as an alternative to the Sketch tool.
It was not a problem in my case, but it may be in yours, depending on how and why you need to draw on the PDF.