It doesn’t look like there’s actually anything technically wrong with that - the maths is all doing its job correctly, but if you draw paths that are thicker than the width of the shape, of course you can expect to see a few bits overshooting! Try it with a thinner stroke and it looks fine to me.
But , Why stroked line is crossing only on the right side of “M” where as the left side is stroked on the path exactly.
It is happenning only for shapes like "V’ inverted “V”. That too only on mitered style.
Curved and Bevelled are not producing such lines even the Stroke thickness is more.
Is it the correct behavior of mitered.
I think that the two inner joints of the M are made up of slightly different points - most likely one of them has a double point on the curve where the path starts and ends, and this would create a different stroke outline. I really don’t think it’s a failure in the algorithm, just an artifact caused by this particular path.