The joint following error is a result of the machine not being able to accomplish the movement desired (following error). It is not directly related with the code, although your different code may push the machine to move faster or in a part of the table where is more difficult to move the machine, so a error can appear.
Basically if the mechanics are ok, and the settings are ok (following error limit match your hardware), any code will not trigger the following error.