Its because its an object not a collection: Reading external JSON
tl;dr … create your own array from the collection data THEN do stuff with it:
$rules = array ();
$rules[] = array(
'YourThing' => $data->whatever();
);
Obviously i’ve made that up but hopefully you get the idea.