Hello
I'm here to make two remarks.
1) While doing further tests on this bug, I noticed that it does not appear with PHP 7.4.X. The error on my personal server occurs only with PHP 8.0.X
2) Another thing, I am using a Rockettheme template powered by GANTRY 5.5.12 and using the method described above the problem is solved but I noticed that my page assignments are not working anymore. The same assignment is given to all pages despite a lot of manipulations.
On the other hand if I use the proposed solution but I replace the original files by empty files (base.php and router.php), everything becomes normal again: bug corrected and the page assignments are functional.
That can perhaps help other people
Sincerely