Connecting objects with lines

I have several squares set with 8 magnets each. When using the line tool I can’t seem to get consistent connections. I find that when I start at the middle of the square, it connects fine to the center, but when trying to make a permanent connection to any of the magnets, I get one of the following.
a/ the line joins the square but leaves a space between the line end and the square.
b/ I get a solid connection to the magnet and when I move the square around, the line sticks with it
c/ the line connects right to the square visually, but when I move the square around, it doesn’t stick.

I am using an apple pencil with the ipad pro.