is_embed and is_search called incorrectly by wp_robots filter

Most likely this problem is caused by a plugin calling wp_die too early. For instance, if a plugin would decide something is wrong at the init stage and call wp_die then, the query would not have been set yet, resulting in this error (see the action reference for the order in which things happen).

You do not mention how you threw that error in “Hello Dolly”, but I assume you did it early enough to reproduce the error.

The problem with exceptions is, of course, that they occur under very specific circumstances. It could be one plugin or the interplay between several. Or even specific user input. Hunting the root cause down could indeed be complicated.

I do think this is a bug in core, more specifically in those two filter functions that call is_embed and is_search. Those should check for the availability of the functions they call. You could replace them with a filter of your own that does. Something like this (untested):

function wp_robots_noindex_embeds( array $robots ) {
    if (did_action ('parse_query') {
        if ( is_embed() ) {
            return wp_robots_no_robots( $robots );
        }
    }
    return $robots;
}