This is likely because of multiple whitespace characters being before the closing parenthesis. I believe the (read) function is failing to detect this and simply returning nil, which the parser sees as no different than a literal nil so it is appended to the end of the list all the same. It may also be treating the whitespace as a symbol (whitespace is stripped so it would be an empty symbol) and trying to resolve that to a variable. Investigate further.
Example:
% (list 1 2 3 )
(cons 1 (cons 2 (cons 3 (cons nil nil))))
Expected:
(cons 1 (cons 2 (cons 3 nil)))