You're using a for-each type loop, so "i" is actually the object, not the index. This might work:
for level in levels:
level.position.x -= 200 * delta
Also, this looks off to me:
func _ready():
position_cache = levels.size().position
Array.size() returns an integer. You can use back() to get the last array element, if that is what you wanted to do instead.