You are getting that automation error due to recreating the same layout name since that it is already existed , so to work around this and to work around the order of numbering layouts as long as them are numbers ONLY .
Code:
(setq i 0
n 1
doc (vla-get-activedocument (vlax-get-acad-object))
)
(foreach x (layoutlist)
(while (member (itoa (setq i (1+ i))) (layoutlist)))
(vla-put-name
(vla-item (vla-get-layouts doc) x)
i
)
)
(foreach lay
(vl-sort (layoutlist) '(lambda (j k) (< (atoi j) (atoi k))))
(vla-put-taborder (vla-item (vla-get-layouts doc) lay) n)
(setq n (1+ n))
)