I eventually found a solution by replacing my child theme’s functions.php with a fresh copy. The only thing that was in there was google tracking code, and I hadn’t updated that for months, so I am unsure why it was suddenly causing a problem, but maybe this will help someone else.