Hook with 'page.create:after' throws null error

Trying to update a field (myField) only when the draft page is created with a variable( $myVar). I have other Hooks working but this one keeps throwing an error:

‘Call to a member function update() on null’

Simplified code:

 'hooks' => [
 'page.create:after' => function ($newPage, $oldPage) {
          'myField' => $myVar

Anyone any pointers?

The hook has only one parameter, $page.

Thank pixelijn, I’d copy and pasted another hook, apologies for the silly mistake.