Page.update:after works, but doesn't update the panel

This hook works, the text file has the right values. But the panel does not update the values. Why?

'page.update:after' => function($newPage){
    if($newPage->template() == 'course'){
       $maxParticipants = $newPage->instructors()->toUsers()->count() * 5;
       $newPage = $newPage->update(['participantcount' => $maxParticipants])->save();
    }
},

Because the Panel doesn’t know anything about server-side changes until you reload the page.

Ok. Is there an other way to do this?

The only option ATM would be to create a custom field.