Size of integer is 32bit. You have not mentioned the upper size for each element of array. In this case the elements that are getting generated are bigger numbers and sum is even bigger than 32bit value and while considering the sum the bits higher than 32 are simply ignored. So the sum is still satisfying the constraint. You can try this by manually adding the array elements.
It is always recommended to choose the variables of right size as per the requirement to avoid unexpected behavior. In your case it is bit [9:0] and compare against a variable sum that is of size maximum possible bits required for the sum to accommodate the entire result.
Thanks for your reply. My problem is that the size of total_sim_cycles can be variable based on the user configuration. Hence, I have to take a bigger size as int.