Here is an easier fix if you have access to the PHP version you are running – drop back to version any of the PHP 7.x versions – it’s a lot simpler than trying to restore the site.
The error is happening in PHP 8.x versions because they are more strongly typed than PHP 7.x. It will still clog the php log with warning messages, but your site can be up and running right away with the older php.