Without a workbook, I would guess that you have NULLs values. LM function silently drops nulls so you get fewer rows in your results.
Try to filter out the nulls, and the error should disappear.
Let me know if it solved your problem.
Will you be able to provide a windows script which can run a R Script ? Thank for your help !