I guess this is issue with linux, there is some limit in linux when considering the hash/length of a variable (may be we can change this limit with some settings but i am not aware of that).
I also had the same issue when assiging a variable with some details, below are the details of the issue i had and the way we sloved.
Issue occured when i used:
echo "\n\t$toolLogFiles" >> logs/infralogs/$stageName.log
Issue sloved with:
foreach logFile ($toolLogFiles)
echo "\n\t$logFile" >> logs/infralogs/$stageName.log
Hope you can use similar method to get rid of the issue.