Hello,
maybe this code can help you see what I think is happening:
import numpy as np
a = np.arange(10)
print(a)
print(a[8: 16])
print(a[8:])

even if the range i * batch_size:(i+1) * batch_size is larger than the actual number of remaining values in test_preds_fold from the index i * batch_size, there will be no problem for assignement provided than the number of samples is equal to the length of test_preds_fold.