Check machinery's handbook. There are a few different lengths given, one being effective thread length, which is the usable length, and then there is the runout length caused by cutting with a die, which is longer because those threads are useless in function.
Then, you have to make allowance for the distance of the tool from the actual end of the work, to allow for spindle acceleration. There are several different things it could be.
Ya know, you can trial run the program well away from the chuck without a workpiece to be wrecked
First you get good, then you get fast. Then grouchiness sets in.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)