I looked into it more deeply and apologize in advance for my inexperience as a developer.
Since the same configuration is present in the main domain site and in the subdomain site and that in the subdomain the site works with PHP 8.22, I looked elsewhere.
In the functions.php file, in fact, I found a custom function that had errors or rather was not optimized for PHP 8.22 and therefore generated the critical error.
I corrected it and now it works.
Luckily it was not Bricks, in the end, that created problems.
Thanks again!