Few things is for sure: the code I posted might not be totally bullet proof, but it does work. Good news: I'm totally able to reproduce the result you describe: your current layer is off. We can take care of it programmatically, as any other fail safes, of course the code will get more complex as we go. We will dig deeper on that.
Actually we calculate the 2 points using the angle.
Ok, so now...