I have not tested the code, but just from reading I think you should calculate numdiv differently.
You should use fix instead of round:
(setq numdiv (round (/ len divlen)))
If numdiv is rounded up the final value of newlen will be bigger than the length of the curve. And this:
(vlax-curve-getpointatdist obj newlen)
will then return nil.