This is the respective issue as https://www.drupal.org/project/drupal/issues/2245767, and would be a good addition to the features of our layouts system.
Problem/Motivation
Some blocks, like user login, should be shown on 403/404 response pages. Others, like the help block, should not.
Proposed resolution
Add a visibility setting to blocks that restricts visibility to any combination of 200/403/404 responses. Default this to show the block for all responses.
Perhaps in our case it also makes sense to add that visibility conditions to the layouts (besides blocks), so that if people really have the need for it, they can configure a different layout to be used based on response.
Recent comments
Thanks! The site was on PHP 7.0. With assistance from my hosting provider, I updated to PHP 7.4 and now I have access to the site again. No database re-import required.
Locked out of site after updating modules
Thank you very much. I will follow your advice.
Locked out of site after updating modules
The best you can do is test and report. If you find a contrib that doesn't work in php 8.3, create an issue in its queue so it gets fixed. In my experience, I've found that 7.4 is safest...
Locked out of site after updating modules