As I said, I had moved that code from the child theme to a snippet. But, that snippet is now deactivated and I will leave the child theme as you have it.
I will watch to see if the errors continue, and will let you know.
Wondering about the additional code, doesn’t it just redirect to the homepage if an error occurs?
Thanks for helping.