This isn’t really a WordPress question… that said
$recClasses = pa_insertPage($output);
is incorrect. here you should be passing to insertPage whatever the arguments are. Then insertPage will return $output, making $recClasses the same value as $output.
$recClasses = pa_insertPage('your attributes');
// $recClasses now equals $output;