Thanks for everyone helping me out here.
I found a solution, but if anyone could explain why this works all of a sudden, i would be very grateful.
The Code i posted above, all i need to do, was a conditional check if the RepeaterMatrix isnt NULL, then the getNew() call worked:
site/ready.php
<?php namespace ProcessWire;
if(!defined("PROCESSWIRE")) die();
$pages->addHookBefore('Pages::added', function (HookEvent $event){
// Fetch Page Data
$data = $event->arguments(0);
// Fetch Page Object
$page = $this->pages->get($data->id);
// Check if the RepeaterMatrix is not NULL
if($page->product_matrix != null) {
// Save the new RepeaterMatrixPage im going to add, in a Variable
$newItem = $page->product_matrix->getNew();
}
// Safetycheck if i got anything
if($newItem == null) return;
// Set RepeaterMatrixPage Type, so the Correct Type of Item gets created and the Data gets saved in the Correct Fields
// The Field Types are in the Order of their creation in the RepeaterMatrix Field, and they beginn counting at 1
$newItem->repeater_matrix_type = 2;
$newItem->product_properties_title = "Zusätzliche Informationen";
// Save the Item, as it is a Page
$newItem->save();
// Add new Children to the RepeaterMatrixPageArray
$page->product_matrix->add($newItem);
// Save newly created Page again, so the RepeaterMatrix Items are saved in the List.
$page->save();
});
I dont know why this works all of a sudden, but im glad it does.
kind regards
Marc H.