What object to cast in the cast function?

It must be the loop giving you that error. Delete that Loop > drag from that array pin and then recreate Loop.