I think you can determine if the 0 was auto initialized by using the IvyDefaultValues helper:
ch.ivyteam.ivy.scripting.objects.util.IvyDefaultValues.isDefaultObject(Object)
There exists also a community project 'dataClassNuller' 'dataclass-nuller' which helps to nullify auto initialized data class values. See https://sourceforge.net/projects/ivysupplements/files/Helper/https://github.com/ivy-supplements/dataclass-nuller/releases