Testing confirmed that certain capability values (specifically ffffffffffffffff) cause memory allocation errors in capsh:
"xrealloc: cannot allocate 716488832 bytes (57344 bytes allocated)"
These memory errors were being propagated into the output, causing the long sequence of numbers. The fix prevents these errors from affecting the script's output.