Thanks Dragoljub, for responding to my post.
Actually I discovered the main error wasn't the looping issue it has to do with the following
IsObjectValid = '(new System.Collections.Generic.Mscorlib_CollectionDebugView<CMS.CustomTables.CustomTableItem>(item).Items[0]).IsObjectValid' threw an exception of type 'System.Exception'
I have been advised by the support Team that i have been trying to serialize Kentico objects directly, which is not possible, because the object reference many other objects. That I would first need to create your own custom model (class) with only the properties you need, fill it with data from the custom table item, then serialize your custom class.