JSON file pops up after changing status to "Published" in Panel

I suddenly get this strange behaviour inside the panel whenever i try to change the status of an article to “Published”. I always end up getting this JSON displayed:

{"$dialog":{"component":"k-form-dialog","props":{"fields":{"status":{"label":"Select a new status","type":"radio","required":true,"options":[{"value":"draft","text":"Draft","info":"The article is still in draft mode. It can only be seen by editors with panel access."},{"value":"unlisted","text":"In Review","info":"The article is online and can be visited with the direct URL. The team must still give the final go to publish it."},{"value":"listed","text":"Published","info":"The article is online and listed in the blog"}]}},"submitButton":"Change","value":{"status":"draft","position":null}},"code":200,"path":"dialogs\/pages\/journal+titleofarticle\/changeStatus","referrer":"\/"}}

What have you done before this happened? Updated Kirby? If so, to which version, and if not, which Kirby version are you using?

I was adding a function in my config.php. after disabling the function i can change the status again. (I’m using 3.8.1.1 and PHP 8.0.13)

I guess this is solved then?

Yes, I changed the position of the function from the end of the config document inside my hook.